'********************************************************************

'*

'* Function RemoveSC

'*

'*   Author: NetworkAdminKB.com

'*  Created: 2004-11-11

'* Modified: 2004-11-11

'*

'* Purpose: Remove Special Characters from a string.

'*

'* Input:  strAny = Any string

'*

'* Output: Returns the string without Special Characters (vbCr, vbLf, etc.)

'*         Returns the original string if no Special Characters exist.

'*

'********************************************************************

Function RemoveSC(ByVal strAny)

  'Version 1.0 2004-11-11

  Dim strNew, x

 

  For x = 1 to Len(strAny)

    Select Case Mid(strAny, x, 1)

    Case vbCr, vbLf, vbFormFeed, vbNullChar, vbTab, vbVerticalTab

    Case Else

      strNew = strNew & Mid(strAny, x, 1)

    End Select 'Mid(strNew, x, 1)

  Next 'x

 

  RemoveSC = strNew

 

End Function 'RemoveSC

Article ID: 414, Created On: 9/25/2011, Modified: 9/25/2011