capitalizeWords method
Returns the string with the first character of each word capitalized.
Implementation
String capitalizeWords() {
if (isEmpty) return this;
return split(' ').map((word) => word.capitalize()).join(' ');
}
Returns the string with the first character of each word capitalized.
String capitalizeWords() {
if (isEmpty) return this;
return split(' ').map((word) => word.capitalize()).join(' ');
}