Public Class Form1
Public Sub New()
InitializeComponent()
Dim input() As String = {"a", "b", "b", "c", "c", "d"}
Dim output() As String = distinct(Of String)(input)
MsgBox(makeStr(Of String)(output))
End Sub
Public Function distinct(Of T)(ByVal input() As T)
Dim output As New List(Of T)
Dim checkMath As Boolean = False
For Each itemInput As T In input
If Not output.Contains(itemInput) Then
output.Add(itemInput)
End If
Next
Return output.ToArray
End Function
Function makeStr(Of T)(ByVal input() As T)
Dim output As New System.Text.StringBuilder
Dim chrComma As String = ","
For Each inputItem As T In input
output.Append(inputItem.ToString & chrComma)
Next
Return output.ToString
End Function
End Class