r00tb0x
New member
- Joined
- Nov 30, 2010
- Messages
- 2
- Programming Experience
- Beginner
I have a listbox already filled with links from a search engine. I am trying to filter out some of the links from the same domain:
Error
http://abc.net.au/news/stories/test/index.html
Test cricket - Wikipedia, the free encyclopedia <---- remove this link because same as first entry
I've tried many things with no success. Here is my existing code for FilterButton_Click:
It seems so simple in my head, it just isn't working for me.
Error
http://abc.net.au/news/stories/test/index.html
Test cricket - Wikipedia, the free encyclopedia <---- remove this link because same as first entry
I've tried many things with no success. Here is my existing code for FilterButton_Click:
VB.NET:
Private Sub FilterButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FilterButton.Click
'Search and remove same site links'
Dim arrayclean As ArrayList = New ArrayList()
Dim thing As String
For i As Integer = ResultsBox.Items.Count - 1 To 0 Step -1
Dim check As Match = System.Text.RegularExpressions.Regex.Match(ResultsBox.Items(i), "http://.*?/")
If ResultsBox.Items(i).Contains(check.ToString) Then
Else
arrayclean.Add(ResultsBox.Items.Item(i))
End If
Next
ResultsBox.Items.Clear()
For Each thing In arrayclean
ResultsBox.Items.Add(thing)
Next
ResultsCnt.Text = ResultsBox.Items.Count
End Sub
It seems so simple in my head, it just isn't working for me.