capitalize static method

String capitalize(
  1. String s
)

Implementation

static String capitalize(String s) {
  if (isEmptyOrNull(s)) {
    return "";
  }

  if (s.length == 1) {
    return s.toUpperCase();
  }

  return '${s[0].toUpperCase()}${s.substring(1)}';
}