camelCase method

String camelCase()

Implementation

String camelCase() {
  if (isEmpty) {
    return '';
  }
  final words = trim()
      .splitByMultipleSeparators()
      .where((word) => word.isNotEmpty)
      .toList();

  String camelCase = words[0].toLowerCase();

  for (int i = 1; i < words.length; i++) {
    var word = words[i];
    camelCase +=
        word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
  }
  return camelCase;
}