mirror of
https://github.com/LinwoodDev/Butterfly.git
synced 2025-08-17 12:00:48 +08:00
9 lines
257 B
Dart
9 lines
257 B
Dart
extension StringVisualizer on String {
|
|
String toDisplayString() {
|
|
if (isEmpty) return '';
|
|
return this[0].toUpperCase() +
|
|
substring(1).replaceAllMapped(
|
|
RegExp(r'([A-Z])'), (match) => ' ${match.group(1)?.toLowerCase()}');
|
|
}
|
|
}
|