Which of the following two is more efficient? (Or maybe is there a third option that's better still?)
string val = "AStringValue";
if (val.Equals("astringvalue", StringComparison.InvariantCultureIgnoreCase))
OR
if (val.ToLowerCase() == "astringvalue")
?
The first one is the correct one, and IMHO the more efficient one, since the second 'solution' instantiates a new string instance.