Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-27-2004, 06:09 PM   PM User | #1
Bobo
Regular Coder

 
Join Date: Jan 2004
Location: Port Huron, MI, U.S.A.
Posts: 280
Thanks: 0
Thanked 0 Times in 0 Posts
Bobo is an unknown quantity at this point
Question replace()

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?
__________________
Oh, was I supposed to put something here? ........
Bobo is offline   Reply With Quote
Old 12-27-2004, 06:15 PM   PM User | #2
mark87
Senior Coder

 
Join Date: Dec 2004
Location: Essex, UK
Posts: 2,636
Thanks: 0
Thanked 0 Times in 0 Posts
mark87 is on a distinguished road
Well to replace I think you can do something like this -

Code:
document.body.innerHTML=document.body.innerHTML.replace("1st String","2nd String");
mark87 is offline   Reply With Quote
Old 12-27-2004, 07:06 PM   PM User | #3
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
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
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 12-28-2004, 07:03 PM   PM User | #4
Bobo
Regular Coder

 
Join Date: Jan 2004
Location: Port Huron, MI, U.S.A.
Posts: 280
Thanks: 0
Thanked 0 Times in 0 Posts
Bobo is an unknown quantity at this point
Thanks!
__________________
Oh, was I supposed to put something here? ........
Bobo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:01 PM.


Advertisement
Log in to turn off these ads.