How can I check in Visual Basic if string has duplicate symbols
<p>I'm making Bulls And Cows game and I want to randomly generate a number with four different digits. </p>

<pre><code>Randomize()
Do
    Random = Int(9000 * Rnd()) + 1000
    'If (hasDupes = True)
    randomTwo = Random
    For i = 0 To randomTwo.Length - 1
        For j = 0 To randomTwo.Length - 1
            If randomTwo(i) = randomTwo(j) Then
                dupes = False
                Exit For
            End If
        Next
    Next
Loop Until dupes = True
</code></pre>

<p>^ That's what I have so far but it ain't working. Is there any function how I can find if there are duplicate characters or where is my mistake ?</p>