VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This Function makes sure you do not have any unseen characters that may exist in a string or text.

by Anthony Loera (7 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 21st August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This Function makes sure you do not have any unseen characters that may exist in a string or text. It is quick, and effective. You can also

Rate This Function makes sure you do not have any unseen characters that may exist in a string or text.



'AL -04/03/2001- www.brainclone.com has free organized code for bulk download
'Process:   Function Cleans a string from Special, CTRL,Return, and characters not
'-  normally visible. Only allows visible characters in string, strips out others.
'Vars:      strString:  string you want to clean
'Returns:   Clean string to cleanChars

    Dim x As Long
    Dim strAns As String
    Dim strOut As String
    
    For x = 0 To 31
        strAns = Replace(strString, Chr(x), Space(1))
    Next x
    x = 0
    For x = 127 To 255
        strAns = Replace(strAns, Chr(x), Space(1))
    Next x

    strAns = Replace(strAns, vbCrLf, Space(1))
    strAns = Replace(strAns, vbLf, Space(1))
    strAns = Replace(strAns, vbNullString, Space(1))
    strAns = Replace(strAns, vbCr, Space(1))
    strAns = Replace(strAns, vbTab, Space(1))
    strAns = Replace(strAns, vbVerticalTab, Space(1))
    strAns = Replace(strAns, vbNewLine, Space(1))
    
    cleanChars = strAns
End Function

Download this snippet    Add to My Saved Code

This Function makes sure you do not have any unseen characters that may exist in a string or text. Comments

No comments have been posted about This Function makes sure you do not have any unseen characters that may exist in a string or text. . Why not be the first to post a comment about This Function makes sure you do not have any unseen characters that may exist in a string or text. .

Post your comment

Subject:
Message:
0/1000 characters