by Ales Zigon (2 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Mon 18th June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Delete forbidden characters from your string
strNotAllowed = ".,\/*+-~¸¨""""#$%&()=?!'ߤ×÷:;><" 'these are characters we 'don't want in the string
MyString = Trim(Text1.Text)
For n = 1 To Len(MyString)
For m = 1 To Len(strNotAllowed)
If Mid(MyString, n, 1) = Mid(strNotAllowed, m, 1) Then
MyString = Replace(MyString, Mid(strNotAllowed, m, 1), "", 1, -1, vbTextCompare)
End If
Next m
Next n
MyString = Trim(MyString)