C# tip How to String compare

dotnet C#

Here is a quick C# tip, when using string compare don’t use

use the Equals and StringComparison.InvariantCultureIgnoreCase enum.

The thing you need to note is which rules are appropriate current culture, the invariant culture, ordinal or another culture entirely.
One can create the compare from StringComparer.Create(culture, true)

Taswar Bhatti Avatar

Written by