toCapitalize method
Implementation
String toCapitalize({bool capitalizeOnlyFirstLetter = false}) {
if (length == 0) return this;
if (length == 1) return this[0].toUpperCase();
if (capitalizeOnlyFirstLetter) {
return '${this[0].toUpperCase()}${substring(1).toLowerCase()}';
}
return '${this[0].toUpperCase()}${substring(1)}';
}