N
Noozer
Writing some ASP code and I need to take a string, representing a phone
number, and strip out some characters, namely spaces, brackets and hyphens.
I could write
pNum=replace(pNum," ","")
pNum=replace(pNum,"-","")
pNum=replace(pNum,"(","")
pNum=replace(pNum,")","")
....but that's a bit of a pain. Especially since I'll be doing similar
replacements with other data and may have to strip out a larger number of
characters.
I know that this can be done with regular expressions, but all the examples
I see online are several lines in length. Isn't there a simple way to just
say "remove any of these" or "replace any of these with nothing" in a single
line of code?
number, and strip out some characters, namely spaces, brackets and hyphens.
I could write
pNum=replace(pNum," ","")
pNum=replace(pNum,"-","")
pNum=replace(pNum,"(","")
pNum=replace(pNum,")","")
....but that's a bit of a pain. Especially since I'll be doing similar
replacements with other data and may have to strip out a larger number of
characters.
I know that this can be done with regular expressions, but all the examples
I see online are several lines in length. Isn't there a simple way to just
say "remove any of these" or "replace any of these with nothing" in a single
line of code?