String.Equals() not working as intended

前端 未结 6 730
再見小時候
再見小時候 2020-11-28 10:49

I am using LINQ to search through one of my Entity Framework tables and find a \"group\" based on the name. The name is a string and appears to be Unicode (says it is in the

6条回答
  •  眼角桃花
    2020-11-28 11:49

    I like TravyGuy's answer from a technical perspective. For a more direct, practical answer, try using:

    string.Compare(string A, string B, StringComparison.OrdinalIgnoreCase) == 0
    

提交回复
热议问题