toTitleCase method

String toTitleCase()

naive implementation of title case, not using locale; this works for english, but has no guarantees for other languages

First character after each space is upper-cased

Implementation

String toTitleCase() {
  return splitMapJoin(
    RegExp(r'\s+'),
    onNonMatch: (p0) => p0.toSentenceCase(),
  );
}