title: VB Remove duplicate lines from textbox
body: <p>I am trying to extract the urls from the webpage below in the code.
  With this code it works but it give me all the urls a few times.
  I only need them once in my textbox.</p>
  
  <pre><code>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      WebBrowser1.Navigate("https://www.youtube.com/results?search_query=test+search")
  End Sub
  
  Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
      Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
      For Each curElement As HtmlElement In theElementCollection
          If curElement.GetAttribute("href").Contains("/watch") Then
              TextBox1.Text += curElement.GetAttribute("href") &amp; vbCrLf
          End If
      Next
  End Sub
  </code></pre>
  
  <p>Any help appreciated.</p>