Aim: To have only one of each character on the Return string:
Public Shared Function CheckForDuplicates(ByVal vCharCheck As String) As String
Dim vDeDuplicated As String = ""
Dim i As Integer
For i = 1 To vCharCheck.Length ' Count length of string
'vDeDuplicate is blank to start so will always capture first character
'vDeDuplicate is then checked against each character in the incoming string to see if it contains this character already
'thus deduplicting the string
If vDeDuplicated.Contains(Mid(vCharCheck, i, 1)) Then
'Check the new string to see if it exists, if it does it is not allowed
Else
'The character is not found so we add it
vDeDuplicated += Mid(vCharCheck, i, 1)
End If
Next
Return vDeDuplicated
End Function
vCharCheck
determined/populated? where do you assign a value tovDeDuplicated
? \$\endgroup\$