Using Replace function to remove two different characters

Discussion in 'ASP General' started by J. Muenchbourg, Jul 9, 2003.

  1. I'm using replace function to strip 0s from a particular string:
    <%=replace(rs1("racelength"),"0","''"%>

    but I need to also strip empty spaces from the string in question. This
    doesn't work :
    <%=replace(rs1("racelength"),"0"" ","''""''"%>

    can't figure out how to nest the "replace" routine here

    thanx for help
    Muench


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    J. Muenchbourg, Jul 9, 2003
    #1
    1. Advertising

  2. Response.Write Replace(Replace(rs1("racelength"),"0",""))," ","")

    hth,
    Andrew

    * * * Sent via DevBuilder http://www.devbuilder.org * * *
    Developer Resources for High End Developers.
    Andrew Durstewitz, Jul 9, 2003
    #2
    1. Advertising

  3. J. Muenchbourg

    MN Guest

    Andrew Durstewitz <> wrote in message news:<3f0c5191$0$204$>...
    > Response.Write Replace(Replace(rs1("racelength"),"0",""))," ","")
    >
    > hth,
    > Andrew
    >
    > * * * Sent via DevBuilder http://www.devbuilder.org * * *
    > Developer Resources for High End Developers.


    one too many )'s :)
    MN, Jul 11, 2003
    #3
  4. Or use a regular expression

    "MN" <> wrote in message
    news:...
    > Andrew Durstewitz <> wrote in message

    news:<3f0c5191$0$204$>...
    > > Response.Write Replace(Replace(rs1("racelength"),"0",""))," ","")
    > >
    > > hth,
    > > Andrew
    > >
    > > * * * Sent via DevBuilder http://www.devbuilder.org * * *
    > > Developer Resources for High End Developers.

    >
    > one too many )'s :)
    Dhananjay Modak, Jul 11, 2003
    #4
  5. Sorry, must have fat finger the extra ")".

    :eek:P
    -Andrew

    * * * Sent via DevBuilder http://www.devbuilder.org * * *
    Developer Resources for High End Developers.
    Andrew Durstewitz, Jul 11, 2003
    #5
    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. Replies:
    10
    Views:
    575
    Duncan Booth
    Feb 10, 2006
  2. Chris Brat
    Replies:
    7
    Views:
    369
    Marc 'BlackJack' Rintsch
    Sep 6, 2006
  3. rvino
    Replies:
    0
    Views:
    4,629
    rvino
    Aug 14, 2007
  4. yogi_bear_79
    Replies:
    4
    Views:
    4,450
    Juha Nieminen
    Mar 6, 2008
  5. V S Rawat
    Replies:
    5
    Views:
    272
    Richard Cornford
    Jul 3, 2007
Loading...

Share This Page