Re: String.Replace Not Working
- From: Brett <Brett@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Aug 2008 06:02:01 -0700
Thanks
Sorry about the multi-post, but you have two groups named JScript.
"Anthony Jones" wrote:
.
"Brett" <Brett@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:52B36AE8-C0EC-4B91-83C4-890821DE1CA3@xxxxxxxxxxxxxxxx
Sorry, if you've seen this one before, but there are 2 JScript newsgroups.
I have a classic ASP page containing a javascript function that runs
string.replace commands, such as
string.replace(/\\x3C/g,""); // < character
(note I also tried one \ instead of 2 before the 3C)
The command doesn't error out, it just does nothing. I checked the string
with an Alert both before and after, but no change. I even tried a simple
replace a with b, but nothing. Again, no error, just no replacing.
I checked many internet sources and my code appears to be correct.
Any ideas?
s = s.replace(/a/g,"b");
replace does not mutate the object against which it is called. It generates
a new string which it returns.
--
Anthony Jones - MVP ASP/ASP.NET
- Follow-Ups:
- Re: String.Replace Not Working
- From: Anthony Jones
- Re: String.Replace Not Working
- References:
- String.Replace Not Working
- From: Brett
- Re: String.Replace Not Working
- From: Anthony Jones
- String.Replace Not Working
- Prev by Date: Re: String.Replace Not Working
- Next by Date: Re: How to free memory in Javascript?
- Previous by thread: Re: String.Replace Not Working
- Next by thread: Re: String.Replace Not Working
- Index(es):
Relevant Pages
|