Answers for "c# Regex similar wor"

C
0

c# Regex similar wor

string s= "This island is a colony; however,it is autonomous and receives no orders from the mother country, autonomy, N.";;
string pattern="autonomous";
Regex r=new Regex(@"\b(?!"+pattern+")"+pattern.Substring(0,pattern.Length/2)+@".*?\b");
r.Replace(s,".");
Posted by: Guest on April-21-2022

Code answers related to "C"

Browse Popular Code Answers by Language