var firefoxIngs = myText.replace(/ /g," ");
This is my string:
"h a"//it has two empty spaces between h and a
After the code it becomes:
"h a"//it has one empty spaces between h and a
I want it to be
"h a"
Why is this happening and how to fix it?
It works as expected
On the string, you might be missing one space.
Result:
Refer LIVE DEMO