lowerCaseFirstChar method

  1. @useResult
String lowerCaseFirstChar()

Converts the first character of the string to lowercase, leaving the rest of the string unchanged.

If the string is empty, it returns an empty string.

Returns: A new string with the first character in lowercase, or an empty string if the original string is empty.

Example:

'MixedCase'.lowerCaseFirstChar(); // Returns 'mixedCase'
'lowercase'.lowerCaseFirstChar(); // Returns 'lowercase'
''.lowerCaseFirstChar();        // Returns ''

Implementation

@useResult
String lowerCaseFirstChar() => isEmpty ? '' : this[0].toLowerCase() + substringSafe(1);