B
Brian Tkatch
I'm looking for a simple way to unique an array of strings. I came up
with this. Does it make sense? Am i missing anything? (Testing seems to
show it to work.)
Public Function Unique(ByVal List() As String) As String()
' Returns the unique values of in array, in an array.
Dim Temp As New
System.Collections.Specialized.StringCollection()
For Each Current_String As String In List
If Not Temp.Contains(Current_String) Then
Temp.Add(Current_String)
Next
ReDim Unique(Temp.Count - 1)
Temp.CopyTo(Unique, 0)
End Function
B.
with this. Does it make sense? Am i missing anything? (Testing seems to
show it to work.)
Public Function Unique(ByVal List() As String) As String()
' Returns the unique values of in array, in an array.
Dim Temp As New
System.Collections.Specialized.StringCollection()
For Each Current_String As String In List
If Not Temp.Contains(Current_String) Then
Temp.Add(Current_String)
Next
ReDim Unique(Temp.Count - 1)
Temp.CopyTo(Unique, 0)
End Function
B.