toCapitalized method

String toCapitalized()

Capitalizes the first letter of this string and returns a new one.

Implementation

String toCapitalized() =>
    substring(0, 1).toUpperCase() + substring(1).toLowerCase();