Answers for "remove tag anchor and inside tag from html raw text c#"

C#
0

remove tag anchor and inside tag from html raw text c#

using System;
using System.Text.RegularExpressions;

public class Test
{
        public static void Main()
        {
                String sample = "<a href="http://test.com" rel="nofollow">LoremIpsum.Net</a> is a small and simple static site that <a href="http://test123.com" rel="nofollow">provides</a> you with a decent sized passage without having to use a generator. The site also provides an all caps version of the text, as well as translations, and an <a href="http://test445.com" rel="nofollow">explanation</a> of what this famous.";

                String re = @"<a [^>]+>(.*?)</a>";
                Console.WriteLine(Regex.Replace(sample, re, "$1"));
        }
}
Posted by: Guest on December-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language