Mega Code Archive

 
Categories / C# / XML
 

Load Xml String

using System; using System.Xml; public class XmlUtil {     #region LoadString(ref string val, XmlNode parent, string nodeName)     public static void LoadString(ref string val, XmlNode parent, string nodeName)     {         try         {             XmlElement elem = parent[nodeName];             if (elem != null)                 val = elem.InnerText.Trim();         }         catch         {             val = string.Empty;         }     }     #endregion }