UrlEncodingTryDecodeToBytes(ReadOnlySpan`1Char, Boolean, Byte) Method

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

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
C#
public static bool TryDecodeToBytes(
	ReadOnlySpan<char> value,
	bool decodePlusChars,
	out byte[]?? bytes
)

Parameters

value  ReadOnlySpanChar
The read-only character span to decode.
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