2023-06-27 13:26:23 -04:00
|
|
|
extension StringExtension on String {
|
|
|
|
String capitalize() {
|
2023-06-27 12:28:15 -05:00
|
|
|
return split(" ")
|
|
|
|
.map(
|
|
|
|
(str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
|
|
|
|
)
|
2023-06-27 13:26:23 -04:00
|
|
|
.join(" ");
|
|
|
|
}
|
|
|
|
}
|