Partager via


SymbolDisplay.FormatPrimitive(Object, Boolean, Boolean) Method

Definition

Returns a string representation of an object of primitive type.

public:
 static System::String ^ FormatPrimitive(System::Object ^ obj, bool quoteStrings, bool useHexadecimalNumbers);
public static string FormatPrimitive (object obj, bool quoteStrings, bool useHexadecimalNumbers);
static member FormatPrimitive : obj * bool * bool -> string
Public Shared Function FormatPrimitive (obj As Object, quoteStrings As Boolean, useHexadecimalNumbers As Boolean) As String

Parameters

obj
Object

A value to display as a string.

quoteStrings
Boolean

Whether or not to quote string literals.

useHexadecimalNumbers
Boolean

Whether or not to display integral literals in hexadecimal.

Returns

A string representation of an object of primitive type (or null if the type is not supported).

Remarks

Handles Boolean, String, Char, SByteByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Double, Single, Decimal, and null.

Applies to