Remove invalid characters from string
Function RemoveInvalidCharacters(data As String) As String
'remove a character set from a string
Dim objRegex As Object
Set objRegex = CreateObject("vbscript.regexp")
With objRegex
.Global = True
'characters to be replaced
.Pattern = "[\<\>\*\'\,\$\#\@\.\""\?\!\/\[\]\:\|\\\/\?|]"
RemoveInvalidCharacters = .Replace(data, "")
End With
End Function
Comments