toTitleCase property

String get toTitleCase

Capitalizes the first letter of each whitespace-delimited word.

Implementation

String get toTitleCase => trim()
    .split(_whitespaceRegExp)
    .where((w) => w.isNotEmpty)
    .map((w) => w.toSentenceCase)
    .join(' ');