title: why two strings that look identical are not same?
body: <p>I am a newbie in c# and coding. Please pardon me if I am asking a silly question. I first used <code>Directory.GetFiles()</code> as follows:</p>
  
  <pre><code>var savedfiles = Directory.GetFiles(@"C:\DiaryFiles");
  </code></pre>
  
  <p>Now, I have a textbox <code>bunifuTextbox1</code> in which I write some text "Amogh" which is a file name from "C:\DiaryFiles". Then I am using a function <code>nameRepair()</code> which is as follows:</p>
  
  <pre><code>private string nameRepair(string suspectfile)
  {
      return  @"C:\DiaryFiles\" + suspectfile + ".akb";
  }
  </code></pre>
  
  <p>(.akb is an extension). But, problem occurs when I try to do this:</p>
  
  <pre><code>foreach(string f in SavedFiles)
      if(f.Trim() == nameRepair(form.bunifuTextbox1.text).Trim())
      {
          //this code is not executed:(
      }
      else
      {
          //this part is executed
      }
  </code></pre>
  
  <p>Condition for <code>if</code> is always returning false</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Edit</strong>:(I am posting whole code)</p>
  
  <pre><code>foreach (string f in savedfiles)
  {
      this.label = new Label();
      this.label.Location = new System.Drawing.Point(108, 36 + customLabels.Count * 26);
      this.label.Name = f;
      this.label.Text = (f.Replace(@"C:\DiaryFiles\","")).Replace(".akb", ""); 
      this.label.Width = f.Length * 20;
      this.label.BackColor = System.Drawing.Color.Black;
      if(f.Trim() == nameRepair(form.bunifuTextbox1.text.Trim()))
      {
          this.label.ForeColor = System.Drawing.Color.Red;
      }
      else
      {
          this.label.ForeColor = System.Drawing.Color.White;
      }       
  }
  </code></pre>
  
  <p>I tried to create labels at run time and want to change color of text on the labels which matches textbox text. </p>
  
  <p>You can see the whole project here:</p>
  
  <p><a href="https://drive.google.com/open?id=1q6eqiGvWnQYV7f_t8abG1cTwbVlUIqbm" rel="nofollow noreferrer">https://drive.google.com/open?id=1q6eqiGvWnQYV7f_t8abG1cTwbVlUIqbm</a></p>