XmlReader.IsName Method (String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a value indicating whether the string argument is a valid XML name.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public static bool IsName(
	string str


Type: System.String

The name to validate.

Return Value

Type: System.Boolean

true if the name is valid; otherwise, false.

Exception Condition

The str value is null.

This method uses the W3C XML 1.0 Recommendation to determine whether the name is valid.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top