capitalizeFirst method
Capitalizes only the first letter of the string.
Example: "hello world" → "Hello world"
Implementation
String capitalizeFirst() {
if (isEmpty) return '';
return this[0].toUpperCase() + substring(1);
}
Capitalizes only the first letter of the string.
Example: "hello world" → "Hello world"
String capitalizeFirst() {
if (isEmpty) return '';
return this[0].toUpperCase() + substring(1);
}