wrote on 08 sep 2007 in microsoft.public.inetserver.asp.general:
I want to replace everything after a colon (:) in a string using ASP
Replace.
There is no asp replace,
since asp is not a language but a platform,
having vbscript and jscript as languages.
Here's an example of the procedure I want to perform:
dim hr1, hr1replace
hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
hr1replace = REPLACE(hr1,": [WILDCARD GOES HERE]","")
so the remaining text is only: H.R. 1908
Use regular expression in vbscript
:
hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
Set regEx = New RegExp
regEx.Pattern = ":.*$"
hr1replace = regEx.Replace(hr1,"")
or the same in jscript, much nicer:
hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
hr1replace = hr1.replace(/:.*$/,"")
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)