-
-
Save ndthanh/bb9b2679c09a14c871be12444934b971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function RemoveDupeChars(text As String) As String | |
Dim dictionary As Object | |
Dim char As String | |
Dim result As String | |
Set dictionary = CreateObject("Scripting.Dictionary") | |
For i = 1 To Len(text) | |
char = Mid(text, i, 1) | |
If Not dictionary.Exists(char) Then | |
dictionary.Add char, Nothing | |
result = result & char | |
End If | |
Next | |
RemoveDupeChars = result | |
Set dictionary = Nothing | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment