I have been trying to split a string with space when camel case happens. This is so far I can:
CamelCaseSplit = (inputString) => {
const f = str => str.match(/^[A-Z]?[^A-Z]*|[A-Z][^A-Z]*/g).join('
<CAMEL> ');
return f(inputString);
}
It can handle string likes "camelCase", "simple", "number1Case2".
But fails for "ABCWordDEF" and gives me "A B C Word D E F" instead of "ABC Word DEF".
Also the output of "abcDeF123" should be "abc De F123"
How to properly implement splitting into camel case?