可以使用以下方法去除重复数据:
Dim arr() As Integer = {1, 2, 3, 3, 4, 5, 5}
Dim list As New List(Of Integer)
For Each num As Integer In arr
If Not list.Contains(num) Then
list.Add(num)
End If
Next
arr = list.ToArray()
Dim arr() As Integer = {1, 2, 3, 3, 4, 5, 5}
Dim set As New HashSet(Of Integer)
For Each num As Integer In arr
set.Add(num)
Next
arr = set.ToArray()
这两种方法都可以去除数组中的重复数据,选择哪一种方法取决于你对List或HashSet的偏好。