1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim OldList As New List(Of String)
Dim NewList As New List(Of String)
OldList.Add("aaaa".ToString)
OldList.Add("aaaa".ToString)
OldList.Add("cccc".ToString)
OldList.Add("aaaa".ToString)
OldList.Add("bbbb".ToString)
OldList.Add("aaaa".ToString)
NewList = DelDblEntr(OldList)
ListBox1.Items.AddRange(NewList.ToArray)
End Sub
Private Function DelDblEntr(ByVal RntyList As List(Of String)) As List(Of String)
DelDblEntr = Nothing
DelDblEntr = RntyList.Distinct().ToList()
End Function
|