capitalized method

String capitalized()

Implementation

String capitalized() {
  return length > 1
      ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}'
      : length == 1
      ? this[0].toUpperCase()
      : '';
}