toTitleCase method Null safety
Title Case a String
E.g. "hello world" will become "Hello World"
Implementation
String toTitleCase() => this
.replaceAll(RegExp(' +'), ' ')
.split(" ")
.map((str) => str.toCapitalized())
.join(" ");
Title Case a String
E.g. "hello world" will become "Hello World"
String toTitleCase() => this
.replaceAll(RegExp(' +'), ' ')
.split(" ")
.map((str) => str.toCapitalized())
.join(" ");