I want to add a space between a lowercase and uppercase in one string. For example:
FruityLoops
FirstRepeat
Now I want to add a space between the lowercase and uppercase letters. I don't know how I should start in JavaScript. Something with substr or search? Can somebody can help me?
var str = "FruityLoops";
str = str.replace(/([a-z])([A-Z])/g, '$1 $2');
Example: http://jsfiddle.net/3LYA8/