mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
9 lines
288 B
Dart
9 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(' ');
|
|
}
|