UrlEncodingTryDecodeToBytes(String, Boolean, Byte) Method

Tries to decode a URL-encoded String to a Byte array and allows to specify whether or not PLUS characters ('+', U+002B) should be decoded to 0x20 (SPACE ' ').

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.3+0b4e3cc14d7870504a77e224d298b921bfc6f2ee
C#
public static bool TryDecodeToBytes(
	string? value,
	bool decodePlusChars,
	out byte[]?? bytes
)

Parameters

value  String
The String to decode, or null.
decodePlusChars  Boolean
true to decode PLUS characters ('+', U+002B) to 0x20 (SPACE ' '), or false to include the PLUS characters unchanged as 0x2B in bytes.
bytes  Byte
After the method completes successfully, contains a Byte array that represents the decoded content of value.

Return Value

Boolean
true if the decoding was successful, otherwise false.

See Also