EncodeNmToken Method

XmlConvert.EncodeNmToken Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Verifies the name is valid according to the XML specification.

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

public static string EncodeNmToken(
	string name
)

Parameters

name
Type: System.String
The name to be encoded.

Return Value

Type: System.String
The encoded name.

This method guarantees that the name is valid according to the XML specification. For example, if you passed this method the invalid name 70+, it returns 70_x002b_ which is a valid XML name.

If name is null or String.Empty then you get the same value returned.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft