This code samle shows how to strip all special characters including space in vb.net
Public Function strip(ByVal des As String) Dim strorigFileName As String Dim intCounter As Integer Dim arrSpecialChar() As String = {".", ",", "<", ">", ":", "?", """", "/", "{", "[", "}", "]", "`", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "-", "+", "=", "|", " ", "\"} strorigFileName = des intCounter = 0 Dim i As Integer For i = 0 To arrSpecialChar.Length - 1
Do Until intCounter = 29 des = Replace(strorigFileName, arrSpecialChar(i), "") intCounter = intCounter + 1 strorigFileName = des Loop intCounter = 0 Next Return strorigFileName
End Function
|
No responses found. Be the first to respond and make money from revenue sharing program.
|