capitalizeFirst method

String capitalizeFirst()

Capitalizes only the first letter of the string.

Implementation

String capitalizeFirst() {
  if (isEmpty) return this;
  return this[0].toUpperCase() + substring(1);
}