1
Answer

How to remove the anchor tag from a string in C#

Photo of Ashish Dhyani

Ashish Dhyani

12y
10.7k
1
String sample = "<a href=\"http://test.com\">LoremIpsum.Net</a> is.";
String re = @"<a [^>]+>(.*?)<\/a>";
sample =Regex.Replace(sample, re, "$1"));

Answers (1)