IN VB.NET
Public Function RemoveDuplicateItems(ByVal itemList As String()) As String()
Dim tempArray As ArrayList = New ArrayList
For i As Integer = 0 To itemlist.Count - 1
If Not tempArray.Contains(itemList.GetValue(i)) Then
tempArray.Add(itemList.GetValue(i))
End If
Next
Return tempArray.ToArray(GetType(String))
End Function
Dim List As String() = {"Nokia", "Samsung", "LG", "Motorola", "Nokia", "Samsung"}
RemoveDuplicateItems(List)
No comments:
Post a Comment