Posted By

hzarka on 10/11/11


Tagged

vba


Versions (?)

RemoveCharacters


 / Published in: Visual Basic
 

  1. Function RemoveCharacters(InString As String) As String
  2. Dim intLoopCounter As Integer
  3. Dim intStringLength As Integer
  4. Dim intASCIIVal As Integer
  5. intStringLength = Len(InString)
  6. InString = LCase(InString)
  7. For intLoopCounter = 1 To intStringLength
  8. intASCIIVal = Asc(Mid(InString, intLoopCounter, 1))
  9. If (intASCIIVal >= 97 And intASCIIVal <= 122) Or (intASCIIVal >= 48 And intASCIIVal <= 57) Then
  10. RemoveCharacters = RemoveCharacters + Mid(InString, intLoopCounter, 1)
  11. End If
  12. Next intLoopCounter
  13. End Function

Report this snippet  

You need to login to post a comment.