Sanitize string

Function CleanText(ByVal inText As String) As String
    Dim AlphaNumeric As String
    AlphaNumeric = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    AlphaNumeric = AlphaNumeric & "abcdefghijklmnopqrstuvwxyz"
    AlphaNumeric = AlphaNumeric & " 0123456789,<.>/?;:'""[{]}\/`~!@#$%^&*()-_=+"
    
    Dim pos As Long
    Dim x As String
    Dim Target As String
    Target = ""
    For pos = 1 To Len(inText)
        x = Mid(inText, pos, 1)
        If InStr(AlphaNumeric, x) Then Target = Target & x
    Next
    
    CleanText = Target
End Function

Torna su
Categoria

Visual Basic 6 (995)


Autore

Marco Cecchetti


Data pubblicazione.

04/05/2021



Recensioni

Articolo non ancora recensito