I have a regular expression in JavaScript to split my camel case string at the upper-case letters using the following code (which I subsequently got from here):
Hi I saw no live demo , thanks @michiel-dral
var tests =[ "camelCase",
"simple",
"number1Case2"]
function getCamelCaseArray(camel) {
var reg = /([a-z0-9])([A-Z])/g;
return camel.replace(reg, '$1 $2').split(' ');
}
function printTest(test) {
document.write(''+test + '=' + getCamelCaseArray(test)+'
');
}
tests.forEach(printTest);