Click or drag to resize

SymbolDisplayFormatLiteral Method (Char, Boolean)



Returns a C# character literal with the given value.

Namespace:  Microsoft.CodeAnalysis.CSharp
Assembly:  Microsoft.CodeAnalysis.CSharp (in Microsoft.CodeAnalysis.CSharp.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public static string FormatLiteral(
	char c,
	bool quote
)

Parameters

c
Type: SystemChar
The value that the resulting character literal should have.
quote
Type: SystemBoolean
True to put (single) quotes around the character literal.

Return Value

Type: String
A character literal with the given value.
Remarks
Escapes non-printable characters.
See Also