---
title: "How to convert html text to plain text in C#?"  
description: "How to convert html text to plain text in C#?"  
author: "Anonymous User"  
published: 2018-03-21  
updated: 2018-03-21  
canonical: https://www.mindstick.com/forum/34444/how-to-convert-html-text-to-plain-text-in-c-sharp  
category: "c#"  
tags: ["c#", "mvc"]  
reading_time: 1 minute  

---

# How to convert html text to plain text in C#?

Hi,

I want to [convert](https://www.mindstick.com/forum/2093/configurationmanager-appsettings-convert-n-to-n-why) [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand) into plain [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions).

Here is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):

```
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.

## Replies

### Reply by Hemant Patel

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!!!


---

Original Source: https://www.mindstick.com/forum/34444/how-to-convert-html-text-to-plain-text-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
