Remove duplicates from List(Of T)

后端 未结 3 555
北海茫月
北海茫月 2021-01-20 17:47

How can I remove my duplicates in the List(Of String)? I was under the assumption that it could work with List(Of T).Distinct, but my result says o

3条回答
  •  遇见更好的自我
    2021-01-20 18:22

    Imports System.Linq
    
    ...
    
    Dim oList As New List(Of String)
    oList.Add("My Cylinder")
    oList = oList.Distinct.ToList()
    

    It's necessary to include System.Linq.

提交回复
热议问题