UrlEncodingTryDecodeToBytes(ReadOnlySpanChar, 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.3+0b4e3cc14d7870504a77e224d298b921bfc6f2ee
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