capitalize method
Returns a new string with the first character in upper case.
'hello'.capitalize() // 'Hello'
Implementation
String capitalize() {
if (isEmpty) return '';
return '${this[0].toUpperCase()}${substring(1)}';
}
Returns a new string with the first character in upper case.
'hello'.capitalize() // 'Hello'
String capitalize() {
if (isEmpty) return '';
return '${this[0].toUpperCase()}${substring(1)}';
}