titleCase function

String titleCase(
  1. String text
)

Convert to Title Case.

Implementation

String titleCase(String text) {
  return _splitWords(
    text,
  ).map((w) => w[0].toUpperCase() + w.substring(1).toLowerCase()).join(' ');
}