I have the following jquery statement. I wish to remove the whitespace as shown below. So if I have a word like:
For example
#Operating/System
I would like the end result to show me#Operating\/System
. (ie with a escape sequence).
- But if I have
#Operating/System test
then I want to show#Operating\/System
+ escape sequence for space. The.replace(/ /,'')
part is incorrect but.replace("/","\\/")
works well as per my requirements.
Please help!
$("#word" + lbl.eq(i).text().replace("/","\\/").replace(/ /,'')).hide();