✨ Finish up connections
This commit is contained in:
14
lib/services/text.dart
Normal file
14
lib/services/text.dart
Normal file
@ -0,0 +1,14 @@
|
||||
extension StringExtension on String {
|
||||
String capitalizeEachWord() {
|
||||
if (isEmpty) return this;
|
||||
|
||||
return split(' ')
|
||||
.map(
|
||||
(word) =>
|
||||
word.isNotEmpty
|
||||
? '${word[0].toUpperCase()}${word.substring(1).toLowerCase()}'
|
||||
: '',
|
||||
)
|
||||
.join(' ');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user