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!

Replacing characters

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
0
0
US
Hi,
I need to replace all occurances of a chracter in a string.
So when I do this:
somestring.replace(/;/g,"") it replaces ALL occurances of ; in the string.
But when I do this:
replace(/(/g,"") it throws an error.

Now when I do this: replace("(","") it only replaces 1 occurence of ( in the string. What gives?

Thanks!!
 
never mind, I found the answer! need to use escape \
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top