toTitleCase method

String toTitleCase()

Converts the string to Title Case.

Implementation

String toTitleCase() {
  if (isEmpty) return this;
  return split(' ').map((str) => str.capitalize()).join(' ');
}