I need a case-insensitive Replace
method for the StringBuilder
class. The code should work with the existing StringBuilder
. An extension method implementation would be nice.
Following is how I plan to use the method:
[TestMethod]
public void StringBuilder_Replace_TTD() {
StringBuilder oRequestText = new StringBuilder(File.ReadAllText("Customer.xml"));
Customer oCustomer = new Customer(null);
foreach (FieldIndex iField in Enum.GetValues(typeof(FieldIndex))) {
oRequestText.Replace("{" iField.ToString() + "}", oCustomer[iField]);
}
Debug.WriteLine(oRequestText.ToString());
}