I want to replace the first occurrence in a given string.
How can I accomplish this in .NET?
using System.Text.RegularExpressions; RegEx MyRegEx = new RegEx("F"); string result = MyRegex.Replace(InputString, "R", 1);
will find first F in InputString and replace it with R.
F
InputString
R