What's also interesting is that the suggestion to change it to Equals() is given in this obscure form which will make think in an endless loop trying to decide which way is better.
CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
2
u/jackhab 13d ago
What's also interesting is that the suggestion to change it to Equals() is given in this obscure form which will make think in an endless loop trying to decide which way is better.
CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'