toCamelCase method

String toCamelCase()

Convert string to camel case.

Implementation

String toCamelCase() {
  if (this == null) {
    throw ArgumentError('string: $this');
  }
  return this!.splitMapJoin(RegExp(r'[_\s]+'),
      onMatch: (match) => match.group(0)!.toUpperCase(),
      onNonMatch: (nonMatch) =>
          nonMatch[0].toUpperCase() + nonMatch.substring(1));
}