capitalizeAllWord method

String capitalizeAllWord()

capitalize first letter of every word

Implementation

String capitalizeAllWord() {
  var result = this[0].toUpperCase();
  for (int i = 1; i < length; i++) {
    if (this[i - 1] == " ") {
      result = result + this[i].toUpperCase();
    } else {
      result = result + this[i].toLowerCase();
    }
  }
  return result;
}