capitalize method

String capitalize()

Returns the string with the first character capitalized.

Implementation

String capitalize() {
  if (isEmpty) return this;
  return '${this[0].toUpperCase()}${substring(1)}';
}