toTitleCase method

String toTitleCase()

Implementation

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