toClassCamelCase method

String toClassCamelCase()

Implementation

String toClassCamelCase() {
  String result = trim().replaceAllMapped(RegExp(r'([-_\s]+[a-zA-Z])'), (match) {
    String matchStr = match.group(0)!;
    return matchStr.substring(matchStr.length - 1).toUpperCase();
  });

  return result.capitalize();
}