This commit is contained in:
2025-09-04 22:10:00 +08:00
parent c527b5e67c
commit 3b375abc09
18 changed files with 150 additions and 6 deletions

14
lib/utils/text.dart Normal file
View 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(' ');
}
}