capitalize method

String capitalize()

Capitalizes this String.

Implementation

String capitalize() {
  if (isBlank) {
    return this;

  } else if (length == 1) {
    return toUpperCase();

  } else {
    return this[0].toUpperCase() + substring(1);
  }
}