changeFirstChar function

String changeFirstChar(
  1. String str, [
  2. bool upper = true
])

Implementation

String changeFirstChar(String str, [bool upper = true]) {
  return (upper ? str[0].toUpperCase() : str[0].toLowerCase()) +
      str.substring(1);
}