title: C# String.Equals returns false on identical strings
body: <p>I am working on a project and for a part of it I need to compare 2 strings.
  My issue comes that whenever I try to compare them I always get false <code>(==, .Equals(), String.Equals()</code> - they all return false, even though I have 2 completely identical strings)</p>
  
  <p>Here is a part of my code.</p>
  
  <pre><code>var tagType = JObject.Parse(json).First.First.ToString();
  foreach (var type in assembly.ExportedTypes)
  {
      var name = tagType;
      var currentType = type.Name;
  
      var a = name.Length;
      var b = currentType.Length;
  
      var result = currentType == name;
      var result1 = currentType.Equals(name);
      var result2 = String.Equals(name, currentType, StringComparison.CurrentCulture);
      var result3 = String.Equals(name, currentType, StringComparison.InvariantCulture);
      var result4 = String.Equals(name, currentType, StringComparison.Ordinal);
      var result5 = String.Equals(name, currentType, StringComparison.CurrentCultureIgnoreCase);
  }
  </code></pre>
  
  <p>Now when debugging my <code>foreach</code>, I eventually reach a point where name and <code>currentType</code> both equal the same string - "AutoIncrementTag". At that same point their lengths (a and b) are equal - 16 characters.</p>
  
  <p>This is what the debug output looks like:</p>
  
  <pre><code>//name -        "AutoIncrementТаg"
  //currentType - "AutoIncrementTag"
  
  //a - 16
  //b - 16
  
  // result - false
  // result1 - false
  // result2 - false
  // result3 - false
  // result4 - false
  // result5 - false
  </code></pre>
  
  <p>And ALL of the comparisons below return false.</p>
  
  <p>I even tried creating a new string out of both "name" and currenType. And nothing.</p>
  
  <p>I am really stuck here. How can two identical strings (same length, so no hidden characters) return false with any kind of comparison.</p>