Function CleanTheString(theString)
'Remove all non Alpha numeric characters from a string. This will include spaces. If you want to keep a character, add it to the strAlphaNumeric string below
'msgbox thestring
strAlphaNumeric = "-#.'()/,_; :0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 'Used to check for numeric characters.
For I = 1 To Len(theString)
strChar = Mid(theString, I, 1)
If InStr(strAlphaNumeric, strChar) Then
CleanedString = CleanedString & strChar
End If
Next
'msgbox cleanedstring
CleanTheString = CleanedString
End Function
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment