titleCase method
Capitalizes the first character of each word.
'hello world'.titleCase() // 'Hello World'
Implementation
String titleCase() {
if (isEmpty) return '';
return split(' ').map((w) => w.capitalize()).join(' ');
}
Capitalizes the first character of each word.
'hello world'.titleCase() // 'Hello World'
String titleCase() {
if (isEmpty) return '';
return split(' ').map((w) => w.capitalize()).join(' ');
}