Feb 12, 2008 #1 SDyke MIS Oct 13, 2005 55 US How can I replace the / in a string I cannot get: myString.replace(///g,"-") to work.
Feb 12, 2008 #2 kaht Programmer Aug 18, 2003 4,156 US Code: myString.replace(/[!]\[/!]//g,"-") to work. Putting that many slashes in a row turns the remainder of the line into a comment. -kaht Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson [small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small] Upvote 0 Downvote
Code: myString.replace(/[!]\[/!]//g,"-") to work. Putting that many slashes in a row turns the remainder of the line into a comment. -kaht Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson [small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
Feb 12, 2008 #3 Diancecht Programmer Jan 8, 2004 4,042 ES I think you have to assing it Code: myString = myString.replace(/\//g,"-"); Cheers, Dian Upvote 0 Downvote