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