I have a dictionary that has keys as string.
One item has peculiar behavior. For the same string, it is not matching. I guess this has something to do with String.Equals behavior.
Even String.Equals is returning wrong result. (I am aware of String intern concept, but this seems to be different issue).
Check the image(watch window) for the issue.

I am filling mappings dictionary (from xml resource file) as
var data = XDocument.Parse(str).Element(RootForXMLValidation).Elements().Where(x => x.Attribute("EcbFieldId") != null);
mappings = data.ToDictionary(x => x.Attribute("BoeField").Value.Trim(),
x => new Mapping { Key = x.Attribute("BoeField").Value.Trim(),
Type = (MappingType)Enum.Parse(typeof(MappingType),
x.Attribute("mappingType").Value), MappingDetail = x });
Why String.Equals behaving this way?
The dash in
keyseems to be an em dash whereas the other is a hyphen.