VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Delete forbidden characters from your string

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

Rate 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)


Download this snippet    Add to My Saved Code

Delete forbidden characters from your string Comments

No comments have been posted about Delete forbidden characters from your string. Why not be the first to post a comment about Delete forbidden characters from your string.

Post your comment

Subject:
Message:
0/1000 characters