title: C# How to comparing two string?
body: <p>I want to comparison two string. First is from the dateTimePicker, and second is from file.</p>
  
  <pre><code>string firtsdate = dateTimePicker1.Value.ToString("yyyy-MM-dd");  
  string seconddate = dateTimePicker2.Value.ToString("yyyy-MM-dd"); 
  
  string FilePath = path;
  
  string fileContent = File.ReadAllText(FilePath);
  string[] integerStrings = fileContent.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
  
  int count = 0;
  
  for (int n = 0; n &lt; integerStrings.Length;)            
  {
      count = integerStrings[n].Length;               
      //Console.Write(count + "\n");
      count--;                                         
      if (count &gt; 2)                                  
      {
          string datastart;
          string dataend;
  
          if (integerStrings[n] == firtsdate)
          {
              datastart = integerStrings[n];
              Console.Write(datastart);
              dataend = (DateTime.Parse(datastart).AddDays(1)).ToShortDateString();
              Console.Write(dataend + "\n");
          }
          else
          {
              n = n + 7;
          }
      }
  }
  </code></pre>
  
  <p>File looks like this:</p>
  
  <ul>
  <li>2016-07-01</li>
  <li>2016-07-02</li>
  <li>2016-07-06</li>
  <li>...</li>
  </ul>
  
  <p>Problem is that they do not want to compare two of the same value, like 2016-07-02 == 2016-07-02 (from file).</p>