Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation.
The name, if it is a valid XML name.
Type Reason ArgumentNullException name is null or string.Empty. System.Xml.XmlException name is not a valid XML name.
This method can be used with the System.Xml.XmlWriter class in the following manner.
Example
try{ writer.WriteStartElement(XmlConvert.VerifyName("item"),"bar"); } catch(Exception e) { Console.WriteLine("error"); }