
Here’s a function that will remove duplicate items in a array. The code is for VB.net.
The code:
Function RemoveDuplicates(ByVal initialArray As String())
Dim i As Integer
Dim j As Integer
Dim newArray(0) As String
For i = 0 To UBound(initialArray)
For j = 0 To UBound(initialArray)
If Not initialArray(i) = "" Then
If Not j = i Then
If initialArray(i) = initialArray(j) Then
initialArray(j) = ""
End If
End If
End If
Next
Next
j = 0
For i = 0 To UBound(initialArray)
If Not initialArray(i) = "" Then
ReDim Preserve newArray(j)
newArray(j) = initialArray(i)
j += 1
End If
Next
Return newArray
End FunctionHow to randomize an array in VB.net
Do you want to randomize the items in an array with VB.net?...
VB.net: Update Listbox with Time,Text then Autoscroll
When making applications in VB.net I often use a Listbox to ...
VB.net: Auto Scroll a Listbox
Do you want to make a Listbox in VB.net auto scroll to the l...
