toTitleCase method
Converts the string to title case.
hello world -> Hello World
Implementation
String toTitleCase() => replaceAll(RegExp(' +'), ' ')
.split(' ')
.map((str) => str.toCapitalized())
.join(' ');
Converts the string to title case.
hello world -> Hello World
String toTitleCase() => replaceAll(RegExp(' +'), ' ')
.split(' ')
.map((str) => str.toCapitalized())
.join(' ');