toUpperCamelCase function

String toUpperCamelCase(
  1. String text
)

Converts strings to Upper Camel Case.

Implementation

String toUpperCamelCase(String text) {
  final RegExp separatorPattern = RegExp(r'[ _-]');
  return text.split(separatorPattern).map((String word) {
    return word.isEmpty
        ? ''
        : word.substring(0, 1).toUpperCase() + word.substring(1);
  }).join();
}