I need a function that completely removes all special characters (visible / invisible) from a string, except for AZ, az, 0-9. I already prepared some function in advance, and I found its left commas (,) somehow: O. and maybe I don't know anymore. Could you take a look and consult:
Function RemoveSpecialChars(Tekst As String) As String
Dim a$, b$, c$, i As Integer
a$ = Tekst
For i = 1 To Len(a$)
b$ = Mid(a$, i, 1)
If b$ Like "[A-Z,a-z,0-9]" Then
c$ = c$ & b$
End If
Next i
RemoveSpecialChars = c$
End Function
source
share