Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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"));
        }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: attributes C# reflection variable update site:stackoverflow.com 
Csharp :: what is string args in c# 
Csharp :: c# quaternion eular calculator 
Csharp :: belgium 251 PRG Prac 
Csharp :: vb.net delete a line from text file 
Csharp :: C# count specific words in string 
Csharp :: Reading a date from xlsx using open xml sdk 
Csharp :: universities in greece 
Csharp :: find first occurrence of character in string 
Csharp :: c# make a negative number positive 
Csharp :: randon C# 
Csharp :: extension of c sharp 
Csharp :: unity c# request store review 
Csharp :: insert variables into a string C# 
Csharp :: build a project from dotnet using cli 
Csharp :: c# filesystemwatcher 
Csharp :: convert uk string date to DateTime c# 
Csharp :: unity sword trail 
Csharp :: flsa itextsharp 
Html :: trademark symbol 
Html :: favicon html 
Html :: only accept image file input 
Html :: bullet 
Html :: success green color code 
Html :: input file accept image 
Html :: html import css 
Html :: html href tel 
Html :: js get mouse position canvas 
Html :: import clipboard.js cdn 
Html :: html pi 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =