How to Remove unwanted characters from a string
Posted on July 1, 2011
1 2 3 4 5 6 7 8 9 10 11 12 | 'String Manipulation - How to Remove unwanted characters from a string 'This code removes unwanted characters from a string. Function PurgeString(OldStr As String) As String Dim NewStr As String Dim l As Long For l = 1 To Len(OldStr) If Asc(Mid(OldStr, l, 1)) > 31 Then NewStr = NewStr & Mid(OldStr, l, 1) End If Next PurgeString = NewStr End Function |