I am trying to split up a string by caps using Javascript,
Examples of what Im trying to do:
\"HiMyNameIsBob\" -> \"Hi My Name Is Bob\"
\"Greet
To expand on Rob W's answer.
This takes care of any sentences with abbreviations by checking for preceding lower case characters by adding [a-z], therefore, it doesn't spilt any upper case strings.
// Enter your code description here
var str = "THISSentenceHasSomeFunkyStuffGoingOn. ABBREVIATIONSAlsoWork.".split(/(?=[A-Z][a-z])/).join(" "); // -> "THIS Sentence Has Some Funky Stuff Going On. ABBREVIATIONS Also Work."
console.log(str);