capitalize static method
Capitalizes the first letter of a string.
Example:
StringUtils.capitalize("hello") // "Hello"
StringUtils.capitalize("World") // "World"
Implementation
static String capitalize(String text) {
if (text.isEmpty) {
return text;
}
return '${text[0].toUpperCase()}${text.substring(1)}';
}