firstToLower method

String firstToLower()

Converts first character in this string to lower case.

If the first character of the string is already in lower case, this method returns this.

Example:

'Alphabet'.firstToLower(); // 'alphabet'
'ABC'.firstToLower();      // 'aBC'
'abc'.firstToLower();      // 'abc'

This function uses toLowerCase(), that uses the language independent Unicode mapping and thus only works in some languages.

Implementation

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