SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing From String

    Ok, I have to take away http://www.site.com/cgi-bin/sendmail.asp?to= from a string. This is how I'm doing it...


    Code:
    actionstr=document.forms[0].txttst.value
    actionstr=actionstr.replace(/http://www.mysite.com/cgi-bin/sendmail.asp?to=/gi);
    ...but of course, that doesn't work since it is mixing u the forward slashes (/) with the start and end of the regular expression. How can i fix this?
    Last edited by kgh; Apr 13, 2004 at 18:33.

  2. #2
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops! I forgot you didn't have to use regular expressions, you can use quotes and a normal string! So, in other words, I got it!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •