toTitleCase method

String toTitleCase()

Converts the string to Title Case.

Implementation

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