remove # sign from javascript

Discussion in 'Javascript' started by oliver, Mar 12, 2007.

  1. oliver

    oliver Guest

    why is this not working?


    var testing ="#tesing something # something";
    testing = testing.replace ("/\#/g", "");
    alert (testing);
     
    oliver, Mar 12, 2007
    #1
    1. Advertising

  2. oliver

    oliver Guest

    On Mar 12, 4:13 pm, "oliver" <> wrote:
    > why is this not working?
    >
    > var testing ="#tesing something # something";
    > testing = testing.replace ("/\#/g", "");
    > alert (testing);


    I want it to display -------- "testing something something"
     
    oliver, Mar 12, 2007
    #2
    1. Advertising

  3. oliver

    ASM Guest

    oliver a écrit :
    > why is this not working?


    because

    > var testing ="#tesing something # something";
    > testing = testing.replace ("/\#/g", "");


    testing = testing.replace (/\#/g, "");

    > alert (testing);


    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
     
    ASM, Mar 12, 2007
    #3
  4. oliver

    oliver Guest

    Thanks Stephane !!!!!!!!
     
    oliver, Mar 12, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon-Pierre  Jarry
    Replies:
    2
    Views:
    2,375
    Henrik
    Aug 10, 2005
  2. Kun
    Replies:
    4
    Views:
    1,303
    Tim Chase
    Apr 11, 2006
  3. tshad
    Replies:
    6
    Views:
    21,469
    tshad
    Aug 8, 2006
  4. Jimmy
    Replies:
    1
    Views:
    950
    Cowboy \(Gregory A. Beamer\)
    Nov 21, 2006
  5. Jimmy
    Replies:
    3
    Views:
    2,415
    shimmyshack
    Nov 20, 2006
Loading...

Share This Page