The String class has the
Replace
method like
testString.Replace("..vblf",".vbLf");
.
Similar method is available with
StringBuilder
class as well. If you are going to do many replacements then better use string builder class
as per your comment
here is the sample with regEx
private void button1_Click(object sender, EventArgs e)
{
string input = "bla bla bla ..-anycharacter-vbLf bla bla bla ..-test-vbLf ";
string pattern = "..-[a-z]*-vbLf";
string result1 = Regex.Replace(input, pattern, new MatchEvaluator(removeDot));
MessageBox.Show(result1.ToString());
}
private static string removeDot(Match m)
{
string x = m.ToString().Replace("..", ".");
return x;
}
Extracting the match without the double dot.