I have a string "MySites". I want to place a space between My and Sites.
"MySites"
My
Sites
How can I do this in jQuery or JavaScript?
You can just add a space before every uppercase character and trim off the leading and trailing spaces
s = s.replace(/([A-Z])/g, ' $1').trim()
1.4m articles
1.4m replys
5 comments
57.0k users