Op Englesch liesen Editéieren

Deelen iwwer


CodeGenerator.CreateValidIdentifier(String) Method

Definition

Creates a valid identifier for the specified value.

C#
protected abstract string CreateValidIdentifier(string value);

Parameters

value
String

A string to create a valid identifier for.

Returns

A valid identifier for the value.

Remarks

CreateValidIdentifier tests whether the identifier conflicts with reserved or language keywords, and if so, returns a valid identifier name that does not conflict. The returned identifier contains the same value but includes escape code formatting to differentiate it from conflicting keywords. Typically, if the value requires modification, it is preceded by an underscore "_".

Notiz

The default implementation of this method does nothing.

Applies to

Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also