c# - Display xml special character -


i trying display special characters present in xml. have placed following conditions :

        if (text.contains('<'))         {             text.replace("<", "&lt;");         }         if (text.contains('>'))         {             text.replace(">", " &gt;");         }         if (text.contains('&'))         {             text.replace("&", " &amp;");         }         if (text.contains('>'))         {             text.replace("", "&quot;");         }   

but these escape characters obvious.
can tell how can display these special characters.

you need securityelement.escape

var result = securityelement.escape(text); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -