lastCharToUpperCase property

String lastCharToUpperCase

Implementation

String get lastCharToUpperCase {
  if (length > 0) {
    String upperChar = split('').elementAt(length - 1).toUpperCase();
    String lowerChar = substring(0, length - 1);
    final result = lowerChar + upperChar;
    return result;
  }
  throw Exception('"Invalid string"');
}