JsonValueCreateLiteralUnchecked Method

Creates a JsonValue that forcibly treats value as a JSON literal, even if it is invalid in JSON.

Definition

Namespace: KGySoft.Json
Assembly: KGySoft.Json (in KGySoft.Json.dll) Version: 3.0.0
C#
public static JsonValue CreateLiteralUnchecked(
	string value
)

Parameters

value  String
The value.

Return Value

JsonValue
Null, if value was ; otherwise, a JsonValue, whose Type property returns UnknownLiteral.

Remarks

  Caution

This method makes possible to create invalid JSON.

The Type property of the result will return UnknownLiteral even if value is actually a valid JSON literal.

The AsLiteral property will return the specified value.

Serializing to JSON by the ToString and WriteTo methods preserves the specified value.

See Also