Hunny Software Library Reference

ByteString.PadRight Method (Int32, Byte)

Left-aligns the bytes in this byte string, padding on the right with a specified byte, for a specified total length.

[Visual Basic]
Overloads Public Function PadRight( _
   ByVal totalWidth As Integer, _
   ByVal paddingByte As Byte _
) As ByteString
[C#]
public ByteString PadRight(
   int totalWidth,
   byte paddingByte
);

Parameters

totalWidth
The number of bytes in the resulting byte string, equal to the number of original bytes plus any additional padding bytes.
paddingByte
padding byte value

Return Value

A new ByteString that is equivalent to this instance, but left-aligned and padded on the right with as many paddingByte bytes as needed to create a length of totalWidth.
-or-
If totalWidth is less than the length of this instance, a new ByteString that is identical to this instance.

Exceptions

Exception TypeCondition
ArgumentOutOfRangeExceptiontotalWidth < 0

See Also

ByteString Class | Hunny.Base Namespace | ByteString.PadRight Overload List