snakeToCamel method

String snakeToCamel()

Converts a snake_case string to camelCase.

Example: "hello_world".snakeToCamel()"helloWorld"

Implementation

String snakeToCamel() {
  List<String> splitted = split('_');
  String output = '';

  for (String item in splitted) {
    String value = item;

    if (item != splitted.first) {
      value = item.capitalize();
    }

    output += value;
  }

  return output;
}