I have multiple instances in code where we have done StringComparison.CurrentCultureIgnoreCase for equality comparison of two strings.
Given,
– In our code strings are based on single culture (en)
– There would ‘rarely’ be a case of two strings just varying in case (atleast for most of the values).
I am looking for some opinion on how expensive (performance) is StringComparison.CurrentCultureIgnoreCase than the default stringOne.Equals(stringtwo). If the difference is considerable I would do one full iteration of code and remove at all the places where it does not make sense (for instance, comparing RecordId like this).
Thanks for your interest.
Check out String.Equals Performance Comparison article.