Last post Jul 06, 2010 07:35 AM by lyno
Jun 30, 2010 05:01 AM|lyno|LINK
I'm using the following to strip special characters out of a URL:
Dim urlReg As New Regex("[^\d\w ]")
inurl = urlReg.Replace(inurl, "")
But when it replaces the special characters, it replaces them with their character codes. e.g: 36 for a "$"
Could someone please advise me?
Jun 30, 2010 07:45 AM|HeartattacK|LINK
That would suggest you're getting a url encoded string in urlReg (i.e. eith 36 in place of $) and as such, your replace isn't doing anything at all.
Jul 06, 2010 07:35 AM|lyno|LINK
Thanks, you're right.
I was filtering data from a database, forgetting that prior to insertion, this data is filtered for special characters and they are converted to HTML character codes.