toTitleCase method

String toTitleCase()

Converts all the first letters of each words of a given String into uppercase

Example:

'carlos gutiƩrrez'.toTitleCase(); // Carlos GutiƩrrez

See also:

Implementation

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