capitalize method
Capitalizes each word in the string.
Example:
print('hello world'.capitalize()); // Hello World
Implementation
String capitalize() {
return split(' ').map((e) => e.capitalizeFirst()).join(' ');
}
Capitalizes each word in the string.
Example:
print('hello world'.capitalize()); // Hello World
String capitalize() {
return split(' ').map((e) => e.capitalizeFirst()).join(' ');
}