Developer forum

Forum » Development » Product RTF field, cotanisn html markup.

Product RTF field, cotanisn html markup.

Dmitrij Jazel
Reply

Hi guys,

If I retrieve product description like this:

var desc = i.GetString("Ecom:Product:Field.Review.Value.Clean");

This description contains different html markup like </br>

<p> tags and stuff like that.

 

I wanted to ask if there is a possibility to "strip" this, and get only pure text into my variable?

Tryed things like:

 desc = desc.Replace("</br>", ""); // or desc = desc.Replace("</br>", string.Empty);

But did not helped.

 

Any suggestions?

 

/Dmitrij


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

You can do like this:

var desc = Dynamicweb.Base.StripHTML(i.GetString("Ecom:Product:Field.Review.Value.Clean"));

Votes for this answer: 1

 

You must be logged in to post in the forum