How can I search for and replace Regex in c sharp | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I search for and replace Regex in c sharp

21st Sep 2020, 3:37 AM
SUMON CHOWHAN
SUMON CHOWHAN - avatar
1 Answer
+ 5
using System; using System.Text.RegularExpressions; namespace PrettyBoy { class Program { static void Main(string[] args) { string boy = "I am a boy"; string girl = Regex.Replace(boy, "b.y", "girl"); Console.Write(girl); } } }
21st Sep 2020, 11:07 AM
Calviղ
Calviղ - avatar