.net 5 – C# anyString.Contains(, StringComparison.InvariantCulture) returns true in .NET5 but false in older versions

.net 5 – C# anyString.Contains(, StringComparison.InvariantCulture) returns true in .NET5 but false in older versions

not a bug, a feature

The issue that Ive opened has been closed, but they gave a very good explanation. Now… In .NET 5.0 they began using on Windows (on Linux it was already present) a new library for comparing strings, the ICU library. It is the official library of the Unicode Consortium, so it is the verb. That library is used for CurrentCulture, InvariantCulture (plus the respective IgnoreCase) and and any other culture. The only exception is the Ordinal/OrdinalIgnoreCase. The library is targetted for text and it has some particular ideas about non-text. In this particular case, there are some characters that are simply ignored. In the block 0000-00FF I would say the ignored characters are all control codes (please ignore the fact that they are shown as

.net 5 – C# anyString.Contains(, StringComparison.InvariantCulture) returns true in .NET5 but false in older versions

Leave a Reply

Your email address will not be published. Required fields are marked *