toCapitalized method

String toCapitalized()

Capitalizes the first letter and lower cases everything else.

E.g. someText -> Sometext

Implementation

String toCapitalized() =>
    length > 0 ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' : '';