Click or drag to resize

SymbolDisplayFormatLiteral Method (String, Boolean)



Returns a C# string 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(
	string value,
	bool quote
)

Parameters

value
Type: SystemString
The value that the resulting string literal should have.
quote
Type: SystemBoolean
True to put (double) quotes around the string literal.

Return Value

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