titleCase function

String titleCase(
  1. String s
)

Returns a human-readable title-cased form of a camel-cased String.

Implementation

String titleCase(String s) =>
    s[0].toUpperCase() +
    s.substring(1).replaceAllMapped(_capitalLetter, (m) => ' ${m[0]}');