Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove all ~ from string

Status
Not open for further replies.

tester321

Programmer
Mar 13, 2007
150
CA
Hi i was wondering what the easiest way to remove "~" from a string, i have a string that has many of them and i would like to remove them all, but how?

Thanks
 
[tt]var s,t;
s="a~b~~c~";
t=s.replace(/~/g,"");[/tt]
 
alert("hello ~ t~h~e~re~".replace(/~/ig,""));



Greetings, Harm Meijer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top