capitalize function

String capitalize(
  1. String string
)

Converts the first character of string to upper case and the remaining to lower case.

Implementation

String capitalize(String string) {
  return string.substring(0, 1).toUpperCase() + string.substring(1);
}