StringBuilderExtensionAppendUrlEncoded(StringBuilder, IEnumerableByte) Method

Appends the content of a Byte collection as URL-encoded character sequence to the end of a StringBuilder.

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
C#
public static StringBuilder AppendUrlEncoded(
	this StringBuilder builder,
	IEnumerable<byte>? bytes
)

Parameters

builder  StringBuilder
The StringBuilder to which the characters are appended.
bytes  IEnumerableByte
The Byte collection that contains the data, or null.

Return Value

StringBuilder
A reference to builder after the append operation has completed.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type StringBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

The method treats all Bytes in bytes as 8-Bit characters and replaces all of them - except unreserved RFC 3986 characters - with their hexadecimal representation.

Exceptions

ArgumentNullExceptionbuilder is null.
ArgumentOutOfRangeExceptionIncreasing the capacity of builder would exceed MaxCapacity.

See Also