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.
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.