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

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

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -