Is it possible to do a faster/better way for removing dupes from listview
B4X:
Dim i As Int,j As Int
For i = 0 To lstFav.Size - 1
For j = lstFav.size -1 To (i + 1) Step -1
If lstFav.GetItem(j) = lstFav.GetItem(i) Then
lstFav.RemoveAt( j)
End If
Next
Next
this work flawlessly but i wonder is it better way for b4a im newbie
sorry for my English
Dim m As Map
m.Initialize
Dim i As Int = 0
Do While i < list.GetSize
Dim item As String = list.GetItem(i)
If m.ContainsKey(item) Then
list.RemoveAt(i)
i = i - 1
Else
m.Put(item, "")
End If
i = i + 1
Loop
Dim m As Map
m.Initialize
Dim i As Int = 0
Do While i < list.GetSize
Dim item As String = list.GetItem(i)
If m.ContainsKey(item.ToLowerCase) Then
list.RemoveAt(i)
i = i - 1
Else
m.Put(item.ToLowerCase, "")
End If
i = i + 1
Loop