blob: 5a65bfb47cb76e87b2668acbccbb2a5f2b6c9ec1 [file] [log] [blame] [edit]
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
extension StringUtil on String {
/// Makes the first letter uppercase.
String capitalize() {
return '${this[0].toUpperCase()}${substring(1)}';
}
/// Reverses an ASCII string.
String get reversed => split('').reversed.join();
}