...

View Full Version : replace()



Bobo
12-27-2004, 06:09 PM
How do you use string.replace()? The concept seems simple enough, but I don't understand the $$4\'t\7 type stuff used in the arguements. Is it supposed to be a string? What does it represent and/or do? :confused:

mark87
12-27-2004, 06:15 PM
Well to replace I think you can do something like this -


document.body.innerHTML=document.body.innerHTML.replace("1st String","2nd String");

A1ien51
12-27-2004, 07:06 PM
those funky things is a regular expression, it is easy to understand once you know what it means.

JavaScript Kit has a tutorial on them:
http://javascriptkit.com/javatutors/re.shtml

Eric

Bobo
12-28-2004, 07:03 PM
Thanks!:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum