pjordanna
asked on
CLEAN TXT STRING FOR SQL DB
Hi Experts,
I need a quick function to clean up all non text/numeric characters from a text string.
i.e. str = "1234dghfery"£$%^&*(''|\\"
Becomes
str = "1234dghfery"
Thanks,
PJORDANNA
I need a quick function to clean up all non text/numeric characters from a text string.
i.e. str = "1234dghfery"£$%^&*(''|\\"
Becomes
str = "1234dghfery"
Thanks,
PJORDANNA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah, just a second apart - hongjun and I posted basically the same thing.
do something like this
<%
Function noSpecChar(hmm)
Dim regEx
Set regEx = New RegExp
regEx.Global = true
regEx.Pattern = "[^0-9a-z A-Z]"
noSpecChar = regEx.Replace(hmm,"")
End Function
response.write noSpecChar("AKJHgkjhakhskU YIy87687$% &^%*^*")
%>
<%
Function noSpecChar(hmm)
Dim regEx
Set regEx = New RegExp
regEx.Global = true
regEx.Pattern = "[^0-9a-z A-Z]"
noSpecChar = regEx.Replace(hmm,"")
End Function
response.write noSpecChar("AKJHgkjhakhskU
%>
rats.........same here LOL
LOL well, at least we have consensus.
:-)
honestly now.
the 3 of us came up with the same exact answer.
I think you should split the points at least between hongjun and esw074, as they were 1st to answer it
the 3 of us came up with the same exact answer.
I think you should split the points at least between hongjun and esw074, as they were 1st to answer it
Dim regEx
Set regEx = New RegExp
regEx.Global = true
regEx.Pattern = "[^0-9_a-z A-Z]"
Use like: cleanedstr = regex.replace(str, "")