System.Xml.Serialization.CodeIdentifier.MakeValid Method

Produces a valid code entity name from an input string.

Syntax

public static string MakeValid (string identifier)

Parameters

identifier
The name of a code entity, such as a method parameter, typically taken from an XML element or attribute name.

Returns

A string that can be used as a code identifier, such as the name of a method parameter.

Remarks

The CodeIdentifier.MakeValid(string) method removes any characters that cannot appear in a code identifier. It returns the string "Item" if no characters are valid. It prefixes the string "Item" to an input that begins with an invalid start character, for example, a digit, or a currency symbol.

You do not need to call this method directly.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0