toPascalCase method
Converts a string to PascalCase.
'hello_world'.toPascalCase() // 'HelloWorld'
Implementation
String toPascalCase() {
if (isEmpty) return '';
return trim().split(RegExp(r'[\s_\-]+')).map((w) => w.capitalize()).join();
}
Converts a string to PascalCase.
'hello_world'.toPascalCase() // 'HelloWorld'
String toPascalCase() {
if (isEmpty) return '';
return trim().split(RegExp(r'[\s_\-]+')).map((w) => w.capitalize()).join();
}