toTitleCase method
Converts a string to Title Case. e.g. hello world -> Hello World
Implementation
String toTitleCase() {
if (isEmpty) {
return this;
}
return split(' ').map((word) => word.toCapitalized()).join(' ');
}
Converts a string to Title Case. e.g. hello world -> Hello World
String toTitleCase() {
if (isEmpty) {
return this;
}
return split(' ').map((word) => word.toCapitalized()).join(' ');
}