How can I convert a string either like \'helloThere\' or \'HelloThere\' to \'Hello There\' in JavaScript?
This works for me check this out
CamelcaseToWord("MyName"); // returns My Name
function CamelcaseToWord(string){ return string.replace(/([A-Z]+)/g, " $1").replace(/([A-Z][a-z])/g, " $1"); }