upperCamel method

String upperCamel()

Implementation

String upperCamel() {
  String capitalize(Match match) {
    var text = match[0];
    if (text == null) return '';
    if (text.length >= 2) {
      return '${text[0].toUpperCase()}${text.substring(1)}';
    } else if (text.length == 1) {
      return '${text[0].toUpperCase()}';
    } else {
      return text;
    }
  }

  String skip(String s) => '';

  return splitMapJoin(
    RegExp(r'[a-zA-Z0-9]+'),
    onMatch: capitalize,
    onNonMatch: skip,
  );
}