CodeItBetter Programming Another VB Programming Blog

How to Remove unwanted characters from a string

Posted on January 4, 2009
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

Related posts:

  1. How to Remove all numeric characters from a string
  2. How to remove Duplicate characters from a string
  3. How to Remove all Non Alpha Numeric characters from a given string
  4. How to remove illegal characters from file name
  5. How to Strip special characters from a given String
  6. How to Strip/Remove Text from a given String
  7. How to trim characters from the Beginning of a string
  8. How to check if a string contains only Alphabetical Characters
  9. How to check if a string contains only Alpha Numeric Characters
  10. How to Trim all Non-printing Characters from a given String

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.