title: How can i avoid from the List to append the same text all over again?
body: <p>I have a timer in Form1 for the test im using 10 seconds.
  In the timer i downoad from a website some html code and extract from it specific text and time and date.
  Then i add it to a List
  I'm using timer since i want to get updates if there are any like new text.
  The problem is that each update it's adding again and again the same text even if not new to the List.</p>
  
  <p>So after 3-4 loops in the timer i see the same text like 3-4 times in the List./
  I have a ScrollLabel which is a Label control where i add the text to.</p>
  
  <p>This is the method that make the update:</p>
  
  <pre><code>private void NewsUpdate()
          {
              counter += 1;
              progressBar1.Value = counter;
              label9.Text = counter.ToString();
              label9.Visible = true;
              if (counter == 10)
              {
                  scrollLabel1.Reset();
                  scrollLabel1.Text = " ";
                  scrollLabel1.Invalidate();               
                  client.Encoding = System.Text.Encoding.GetEncoding(1255);
                  page = client.DownloadString("http://rotter.net/scoopscache.html");
                  TextExtractor.ExtractDateTime(page, newText, dateTime);
                  StreamWriter w = new StreamWriter(@"d:\rotterhtml\rotterscoops.html");
                  w.Write(page);
                  w.Close();
                  TextExtractor.ExtractText(@"d:\rotterhtml\rotterscoops.html", newText, dateTime);
                  FilterNews();
                  combindedString = string.Join(Environment.NewLine, newText);
                  this.scrollLabel1.Text = combindedString;
                  counter = 0;
              }
  
          }
  </code></pre>
  
  <p>In a timer tick event i call this metho each 10 seconds.</p>
  
  <p>This is the class TextExtractor:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Text.RegularExpressions;
  
  namespace ScrollLabelTest
  {
      class TextExtractor
      {
          public static void ExtractText(string filePath, List&lt;string&gt; newText, List&lt;string&gt; dateTime)
          {
              List&lt;string&gt; text = new List&lt;string&gt;();
              var htmlDoc = new HtmlAgilityPack.HtmlDocument();
              htmlDoc.OptionFixNestedTags = true;
              htmlDoc.Load(filePath, System.Text.Encoding.GetEncoding(65001));
  
              if (htmlDoc.DocumentNode != null)
              {
                  var nodes = htmlDoc.DocumentNode.SelectNodes("//a/b");
                  foreach (var node in nodes)
                  {
                      text.Add(node.InnerText);
                  }
              }
              List&lt;string&gt; t = filterNumbers(text);
              for (int i = 0; i &lt; t.Count; i++)
              {
                  newText.Add(t[i]);
                  newText.Add(dateTime[i]);
                  newText.Add("");
              }
          }
  
          public static void ExtractDateTime(string text, List&lt;string&gt; newText, List&lt;string&gt; dateTime)
          {
              string pattern1 = "&lt;span style=color:#000099;&gt;(?'hebrew'[^&lt;]*)&lt;/span&gt;";
              Regex expr1 = new Regex(pattern1, RegexOptions.Singleline);
              MatchCollection matches = expr1.Matches(text);
              foreach (Match match in matches)
              {
                  string hebrew = match.Groups["hebrew"].Value;
  
                  string pattern2 = @"[^\s$]*:[^:]*:\s+\d\d:\d\d";
                  Regex expr2 = new Regex(pattern2);
                  Match match2 = expr2.Match(hebrew);
                  string results = match2.Value;
                  int i = results.IndexOf("שעה");
                  results = results.Insert(i + "שעה".Length, " ");
                  dateTime.Add("דווח במקור " + results);
              }
          }
  
          private static List&lt;string&gt; filterNumbers(List&lt;string&gt; mix)
          {
              List&lt;string&gt; onlyStrings = new List&lt;string&gt;();
              foreach (var itemToCheck in mix)
              {
                  int number = 0;
                  if (!int.TryParse(itemToCheck, out number))
                  {
                      onlyStrings.Add(itemToCheck);
                  }
              }
              return onlyStrings;
          }
      }
  }
  </code></pre>
  
  <p>In the method ExtractText i have this lines:</p>
  
  <pre><code>newText.Add(t[i]);
  newText.Add(dateTime[i]);
  newText.Add("");
  </code></pre>
  
  <p>In Form1 in the timer tick event im downloading ever X seconds the html file and extract the text and time and date.</p>
  
  <p>How can i make that it will not add to the newText each 10 seconds only if there is some new text some different text then the one already added before ?</p>
  
  <p>I wanted ot make an updater so i used a timer but what i did instead is appender that adding the same text all over again to the List and to the ScrollLabel.</p>