toPascalCase static method

String toPascalCase(
  1. String source
)

Implementation

static String toPascalCase(String source) => source
    .toLowerCase()
    .replaceAll(RegExp('[^A-Za-z0-9]'), ' ')
    .split(' ')
    .where((word) => word.isNotEmpty)
    .fold('', (concatenation, word) => concatenation + capitalize(word));