toCapitalCase method

String toCapitalCase()

Capitalize string.

Implementation

String toCapitalCase() {
  if (this.isEmpty) {
    return "";
  }

  List<String> newStr = [];

  this.split(" ").forEach((s) {
    newStr.add(s[0].toUpperCase() + s.substring(1));
  });

  return newStr.join(" ");
}