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