Free Support Forum -

HTML decode/unescape possible?

Is it possible to unencode/unescape text using document builder? I have an escaped string in my database and want it displayed within a bookmarked area of a word document:

Dim str1 As String = HttpContext.Current.Server.HtmlDecode("some%20text%20here.")


builder.InsertHtml(str1) //this produces "some%20text%20here"

builder.writeln(str1) //this produces "some%20text%20here"


You can try the following code to unescape strings before insertion:

string s = @"some%20text%20here";

s = Regex.Unescape(s.Replace("%", @"\x")); // this produce "some text here"

Best regards,

Thankyou very much - exactly what i needed.