c# - Display xml special character -
i trying display special characters present in xml. have placed following conditions :
if (text.contains('<')) { text.replace("<", "<"); } if (text.contains('>')) { text.replace(">", " >"); } if (text.contains('&')) { text.replace("&", " &"); } if (text.contains('>')) { text.replace("", """); }
but these escape characters obvious.
can tell how can display these special characters.
you need securityelement.escape
var result = securityelement.escape(text);
Comments
Post a Comment