CSharp examples for System.Xml:XML Attribute
Get As String
using System.Xml.Linq; using System;/* w w w . j a va 2 s.co m*/ public class Main{ #region GetAsString Method public static string GetAsString(this XAttribute attr) { string ret = string.Empty; if (attr != null && !string.IsNullOrEmpty(attr.Value)) { ret = attr.Value; } return ret; } }