String Replace Function
The following code will replace a character or a word with some other character or a word. This is accomplished by the replace function in C#.
strReplace = "This is a test string.";
strReplace = Regex.Replace(strReplace, " is", " was");