VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Trim all extra characters in a string and alterate / change then into a normal value char...¨¨¨¨¨ w

by tHuNd3rSp0t (3 Submissions)
Category: String Manipulation
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Mon 20th January 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Trim all extra characters in a string and alterate / change then into a normal value char...¨¨¨¨¨ will turn into aeiou...very useable on an

Rate Trim all extra characters in a string and alterate / change then into a normal value char...¨¨¨¨¨ w



    'Use TrimXChars [STRING TO TRANSFORM], [WORD CASE]
    '[STRING TO TRANSFORM]
    '  Any string value
    
    '[WORD CASE]
    '  Use 1 to return UpperCase value
    '  Use -1 to return LowCase value
    
     AXChars = "áàãâäª"
     EXChars = "éèêë€&"
     IXChars = "íìîï"
     OXChars = "óòõôö"
     UXChars = "úùûüµ"
     NullXChars = "„†‡‰Š‹Œ“”•—˜™š›œŸ¡¤¥¦¿«®¯±¶¸»¼½¾…ƒ?!#§+-=_¢©ç$¨~^´`'.,;:@¹²³£¬()]}[{/\|" '%* not included 'cause they're SQL-Query criteria types
     

    'Analyze Aa Characters
    For i = 1 To Len(AXChars)
        arg = Replace(arg, Mid(AXChars, i, 1), "a", 1)
        arg = Replace(arg, UCase$(Mid(AXChars, i, 1)), "A", 1)
    Next
    'Analyze Ee Characters
    For i = 1 To Len(EXChars)
        arg = Replace(arg, Mid(EXChars, i, 1), "e", 1)
        arg = Replace(arg, UCase$(Mid(EXChars, i, 1)), "E", 1)
    Next
    'Analyze Ii Characters
    For i = 1 To Len(IXChars)
        arg = Replace(arg, Mid(IXChars, i, 1), "i", 1)
        arg = Replace(arg, UCase$(Mid(IXChars, i, 1)), "I", 1)
    Next
    'Analyze Oo Characters
    For i = 1 To Len(OXChars)
        arg = Replace(arg, Mid(OXChars, i, 1), "o", 1)
        arg = Replace(arg, UCase$(Mid(OXChars, i, 1)), "O", 1)
    Next
    'Analyze Uu Characters
    For i = 1 To Len(UXChars)
        arg = Replace(arg, Mid(UXChars, i, 1), "u", 1)
        arg = Replace(arg, UCase$(Mid(UXChars, i, 1)), "U", 1)
    Next
    'Analyze Null Characters
    For i = 1 To Len(NullXChars)
        arg = Replace(arg, Mid(NullXChars, i, 1), " ", 1)
    Next
    
    'Return the True Value String to compare with
    TrimXChars = Trim$(arg)
    If charCase = -1 Then
        TrimXChars = LCase$(TrimXChars)
    ElseIf charCase = 1 Then
        TrimXChars = UCase$(TrimXChars)
    End If
    
End Function 'Copyright©2003 - tHuNd3rSp0t's


Download this snippet    Add to My Saved Code

Trim all extra characters in a string and alterate / change then into a normal value char...¨¨¨¨¨ w Comments

No comments have been posted about Trim all extra characters in a string and alterate / change then into a normal value char...¨¨¨¨¨ w. Why not be the first to post a comment about Trim all extra characters in a string and alterate / change then into a normal value char...¨¨¨¨¨ w.

Post your comment

Subject:
Message:
0/1000 characters