capitalize function

String capitalize(
  1. String value
)

Capitalizes the first letter of a string.

Example: capitalize("hello") returns "Hello".

Implementation

String capitalize(String value) {
  if (value.isEmpty) return "";
  return value[0].toUpperCase() + value.substring(1);
}