toCamelCase function Null safety

String toCamelCase(
  1. String s
)

Implementation

String toCamelCase(String s) {
  if (s.length < 2) {
    return s.toLowerCase();
  }
  return s[0].toLowerCase() + s.substring(1);
}