Using Replace function to remove two different characters

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Using Replace function to remove two different characters


    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 [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    J. Muenchbourg Guest

  2. Similar Questions and Discussions

    1. Is there a way to replace characters in a string/array
      I am trying to find a function similar to php's str_replace is there something that will allow me to replace a certain character in a variable? ...
    2. find replace a range of characters
      I need to find and replace a range of characters that are contained in brackets like below: It seems the brackets are throwing me off. I just...
    3. remove ^B characters
      Hi there, I've got a problem with ^B characters stored in some mysql tables. In the backup of my DB I read something like that with vi: INSERT...
    4. Replace characters in a Field when bindig data
      I have a drop down field on a form. When binding data to the DataValueField property of the drop down, I need to replace "&" with "%". In code...
    5. Replace * with return characters?
      Is there a way to do this or not? I want to import a file with return characters but it seems impossible. even with the new find/replace...
  3. #2

    Default Re: Using Replace function to remove two different characters

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

    hth,
    Andrew

    * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    Developer Resources for High End Developers.
    Andrew Durstewitz Guest

  4. #3

    Default Re: Using Replace function to remove two different characters

    Andrew Durstewitz <adurstew@devbuilder.org> wrote in message news:<3f0c5191$0$204$75868355@news.frii.net>...
    > Response.Write Replace(Replace(rs1("racelength"),"0",""))," ","")
    >
    > hth,
    > Andrew
    >
    > * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    > Developer Resources for High End Developers.
    one too many )'s :)
    MN Guest

  5. #4

    Default Re: Using Replace function to remove two different characters

    Or use a regular expression

    "MN" <imthedaddynah@hotmail.com> wrote in message
    news:adb8f7dd.0307110644.168f9978@posting.google.c om...
    > Andrew Durstewitz <adurstew@devbuilder.org> wrote in message
    news:<3f0c5191$0$204$75868355@news.frii.net>...
    > > Response.Write Replace(Replace(rs1("racelength"),"0",""))," ","")
    > >
    > > hth,
    > > Andrew
    > >
    > > * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    > > Developer Resources for High End Developers.
    >
    > one too many )'s :)

    Dhananjay Modak Guest

  6. #5

    Default Re: Using Replace function to remove two different characters

    Sorry, must have fat finger the extra ")".

    :oP
    -Andrew

    * * * Sent via DevBuilder [url]http://www.devbuilder.org[/url] * * *
    Developer Resources for High End Developers.
    Andrew Durstewitz Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139