Encoding.UTF8.GetString(stream.ToArray()).Trim() is encoding "<br/>" in c# [Resolved]

Posted by Kasani007 under C# on 1/29/2016 | Points: 10 | Views : 354 | Status : [Member] | Replies : 1
I have a string With <br /> tag

for example:
string result="characters are changed from 4 to 5 <br/> Numbers are changed from 10 to 15";

when i use Encoding.UTF8.GetString(stream.ToArray()).Trim()
it is encoding <br /> tag to &lt;br /&gt;

i don't want to change the <br/> tag as i have to display the text in label with new line .




Responses

Posted by: Sheonarayan on: 1/29/2016 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Use Server.HtmlDecode(result) method that brings back encoded characters to the HTML tag.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response