I have two arraylists that contains links in one and the root url in the other. Sometimes the lists dont equal in number and I would like to iterate through the links list and if it contains a matching root url add it to a third list but also avoid any duplicates. I tried this but am not getting consistent results.
Any ideas appreciated, thanks.
Perhaps there is another way; basically the part in post is a link to a page and contains the root url( which is link in urls). After extracting all these I need to ensure the 2 lists match.
Let me add some more info for clarification. Arraylist post contains the first few items as an example:
0 - blogdetecnologia.com/actualidad/…
1- blogdetecnologia.com
2- landmine.com.ph/para-las-ventas-del-iphone-apple-…
3- landmine.com.ph
and urls contains
0 - blogdetecnologia.com
1 - landmine.com.ph
this is what the problem is; i get new list with the same post items after iterating through it
Any ideas appreciated, thanks.
VB.NET:
For Each link As String In urls
For Each part As String In post
If part.Contains(link) Then
newPost.Add(part)
End If
Next
Next
Perhaps there is another way; basically the part in post is a link to a page and contains the root url( which is link in urls). After extracting all these I need to ensure the 2 lists match.
Let me add some more info for clarification. Arraylist post contains the first few items as an example:
0 - blogdetecnologia.com/actualidad/…
1- blogdetecnologia.com
2- landmine.com.ph/para-las-ventas-del-iphone-apple-…
3- landmine.com.ph
and urls contains
0 - blogdetecnologia.com
1 - landmine.com.ph
this is what the problem is; i get new list with the same post items after iterating through it