devxlogo

FilterString – Remove invalid characters from a string

FilterString – Remove invalid characters from a string

' Filter out all invalid characters in a string.Function FilterString(text As String, ValidChars As String) As String    Dim i As Long, result As String    For i = 1 To Len(text)        If InStr(ValidChars, Mid$(text, i, 1)) Then            result = result & Mid$(text, i, 1)        End If    Next    FilterString = resultEnd Function

devx-admin

Share the Post: