Get Elem Value - CSharp System.Xml

CSharp examples for System.Xml:XML Attribute

Description

Get Elem Value

Demo Code


using System.Xml.Linq;
using System;/*from   w  w  w .  j a  va 2 s  .  c o  m*/

public class Main{
        public static string GetElemValue(this XElement elem, string elemName)
        {
            return elem.Element(elemName)?.Value;
        }
}

Related Tutorials