Given strings like these:
string s1 = "Abc";
string s2 = "ABC";
What is faster:
Regex.Match(s1, s2, RegexOptions.IgnoreCase)
or
s1.ToLower() == s2.ToLower()
If they are the same or the one is faster then the other, so when its better to use one over the other?
Probably the second is faster, but I’d avoid both those approaches.
Better is to use the method
string.Equalswith the appropriateStringComparisonargument:See it working online: ideone