toTitleCase method

String toTitleCase()

Implementation

String toTitleCase() => replaceAll(RegExp(" +"), " ")
    .split(" ")
    .map((str) => str.toCapitalized())
    .join(" ");