How to Strip Non Alpha Numeric from a string
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 'String Manipulation - How to Strip Non Alpha Numeric from a string Option Explicit Public Function StripNonAlphaNumeric(ByVal strExpression As String) As String Dim iLength As Integer, I As Integer Dim sResult As String, sChar As String iLength = Len(strExpression) For I = 1 To iLength sChar = Mid$(strExpression, I, 1) If sChar Like "[A-Za-z_0-9]" Then sResult = sResult & sChar End If Next I StripNonAlphaNumeric = sResult End Function |