I've had this come up in conversations in the past (and it's been on feedback for almost 3 years now), but just realized I never posted the (simple) extension method I use.
A comment on Brad's blog:
(Whidbey actually added it for IndexOf and LastIndexOf, as per the feedback link)
A comment on the BCL team blog:
Thursday, April 06, 2006 3:13 AM by Andrew Webb # Finish off the String class Add a StringComparison parameter to the Contains and Replace methods of the String class.
Thursday, April 06, 2006 3:13 AM by Andrew Webb
Add a StringComparison parameter to the Contains and Replace methods of the String class.
While I could add it for Replace as well, I only typically need Contains.
public static class ExtensionMethods { // BCL should really include this public static bool Contains(this string self, string value, StringComparison comparison) { return self.IndexOf(value, comparison) >= 0; } }