0

I am having HTML content. How can i convert it into plain text so that i can so it in a label.

lbl1.Text = htmlEditor1.Html;

Any suggestion !

1
  • Is there a reason to show this in a label? As Thomas advised you, you could throw away all tags, but the layout won't be nice... It might be an alternativ to show your html within a browser control. Commented Nov 4, 2015 at 9:30

2 Answers 2

3
Regex.Replace(htmlEditor1.Html, "<.*?>", string.Empty);

will strip all HTML tags if that is what you meant.

Sign up to request clarification or add additional context in comments.

Comments

1

did you try this before?

var plaintext = HtmlFilter.ConvertToPlainText(htmlContent);

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.