mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
8 lines
288 B
Dart
8 lines
288 B
Dart
extension StringCasingExtension on String {
|
|
String toCapitalized() =>
|
|
length > 0 ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' : '';
|
|
String toTitleCase() => replaceAll(RegExp(' +'), ' ')
|
|
.split(' ')
|
|
.map((str) => str.toCapitalized())
|
|
.join(' ');
|
|
}
|