toPascalCase property

String get toPascalCase

Implementation

String get toPascalCase {
  final words = toLowerCase()
      .split(RegExp(r'[\s_-]+'))
      .where((w) => w.isNotEmpty);
  return words.map((w) => w[0].toUpperCase() + w.substring(1)).join();
}