toTitle method

String toTitle(
  1. [String def = ""]
)

Implementation

String toTitle([String def = ""]) {
  if (this == null) return def;
  return tokenize(splitAll: true).map((_) => _.capitalize()).join(" ");
}