firstUpper function

String firstUpper(
  1. String input
)

Implementation

String firstUpper(String input) {
  if (input.length > 1) {
    return input.substring(0, 1).toUpperCase() +
        input.substring(1, input.length).toLowerCase();
  } else {
    return input.toUpperCase();
  }
}