I am trying to figure out how to insert a character after a lower case letter but before an upper case letter in a string wherever it occurs. For instance, with the string "HiMyNameIsBob"
, if I were inserting spaces I would want it to return "Hi My Name Is Bob"
. I want to do something similar to what replace() does. I am using JavaScript.
If the answer involves any use of regular expressions, an explanation of the regular expression(s) used would be nice.