upperCaseFirstLetter static method

String upperCaseFirstLetter(
  1. String text, {
  2. bool lowerCaseRest = true,
})

Returns a String with first letter upper cased.

Implementation

static String upperCaseFirstLetter(String text, {bool lowerCaseRest = true}) {
  return '${text.substring(0, 1).toUpperCase()}${lowerCaseRest ? text.substring(1).toLowerCase() : text.substring(1)}';
}