im trying to find a way in c# to replace first occurance of a regular expression in a string.
so if string = " found 1 found 2 found 3"
i want to do something like :
string = replacefirst("found","")
to give results:
string = " 1 found 2 found 3"
thanx
Loading
AlanPosted Jun 25, 2007, 5:06 AM
using System.Text.RegularExpressions;
........
string s = " found 1 found 2 found 3";
Regex r = new Regex("found ");
s = r.Replace(s, "", 1);