How to convert html text to plain text in C#?

Total Post:4

Points:28
C#  Mvc 
C#
 412  View(s)
Ratings:
Rate this:

Hi,

 I want to convert HTML content into plain text.

Here is my code:

Context.EntityName.Where(x=>x.Name=="Test").select(x=> new ModelName
{
Title = x.Content
});

Please give me some idea to convert HTML text to plain text.

  1. Post:44

    Points:310
    Re: How to convert html text to plain text in C#?

    Hi Ethan,

    I analyzed your code. Write your code as follows to convert HTML content to plain text.

    Context.EntityName.Where(x=>x.Name=="Test").select(x=> new ModelName
    {
    Title = x.Content.StripHTML();
    });
    

    I hope it's informative!!!

      Modified On Mar-21-2018 01:34:28 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!