CSharp examples for System.Xml:XML Attribute
Get String Attr
using System.Xml.Linq; using System;//from www . ja v a2 s. com public class Main{ public static string GetStringAttr(this XElement elem, string name) { return elem.GetAttrValue(name); } public static string GetAttrValue(this XElement elem, string attrName) { return elem.Attribute(attrName)?.Value; } }