.NET: String Replace and Ignore Case Sensitivity, String Remove and Ignore Case Sensitivity

9/30/2015 2:31:18 PM

This will replace values in a string while ignoring case sensitivty. The example below actually is a remove version of replace.

string myString = "hello world"
string removeMe = "HELLO";

myString = System.Text.RegularExpressions.Regex.Replace(myString, removeMe, "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);