toCamelCase method
Converts this string to camelCase.
'hello world'.toCamelCase(); // "helloWorld"
'hello_world'.toCamelCase(); // "helloWorld"
'hello-world'.toCamelCase(); // "helloWorld"
'XMLHttpRequest'.toCamelCase(); // "xmlHttpRequest"
Implementation
String toCamelCase() {
final words = _splitWords();
if (words.isEmpty) return '';
return words.first.toLowerCase() + words.skip(1).map((w) => w.isEmpty ? '' : '${w[0].toUpperCase()}${w.substring(1).toLowerCase()}').join();
}