Hunny Software Library Reference

ByteString.PadLeft Method (Int32, Byte)

Right-aligns the bytes in this instance, padding on the left with a specified byte for a specified total length.

[Visual Basic]
Overloads Public Function PadLeft( _
   ByVal totalWidth As Integer, _
   ByVal paddingByte As Byte _
) As ByteString
[C#]
public ByteString PadLeft(
   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 right-aligned and padded on the left with as many paddingChar 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.PadLeft Overload List