capitalize method

String capitalize()

Implementation

String capitalize() => isEmpty
    ? ""
    : length == 1
        ? this[0].toUpperCase()
        : "${this[0].toUpperCase()}${substring(1)}";