ICodeGenerator::CreateEscapedIdentifier Method (String^)

 

Creates an escaped identifier for the specified value.

Namespace:   System.CodeDom.Compiler
Assembly:  System (in System.dll)

[PermissionSetAttribute(SecurityAction::LinkDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = "FullTrust")]
String^ CreateEscapedIdentifier(
	String^ value
)

Parameters

value
Type: System::String^

The string to create an escaped identifier for.

Return Value

Type: System::String^

The escaped identifier for the value.

CreateEscapedIdentifier tests whether the identifier conflicts with reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier will contain the same value but will have escape code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the value with "@" or bracketing the value with "[" and "]".

SecurityAction::LinkDemand

for full trust for the immediate caller. This member cannot be used by partially trusted code.

SecurityAction::InheritanceDemand

for full trust for inheritors. This member cannot be inherited by partially trusted code.

.NET Framework
Available since 1.1
Return to top
Show: