Caselessly comparing strings in C#

前端 未结 6 1216
别那么骄傲
别那么骄傲 2020-12-17 16:21

Let\'s say I have two strings: a and b. To compare whether a and be have the same values when case is ignored, I\'ve always used:

// (Assume a and b have bee         


        
6条回答
  •  情深已故
    2020-12-17 17:08

    Another MSDN article that provides some DOs and DON'Ts and recommendations for what comparison method to use in various cases: New Recommendations for Using Strings in Microsoft .NET 2.0

提交回复
热议问题