Function Formats Justifies Class

LeftJustifyFillFast

Left justify a string. Undersized strings are right-padded to length vWidth with fill character vFillChar. Oversized strings are left as is. Like the LeftJustifyFast function except this one uses a fill character other than the space. "Fast" function has restrictive argument types to avoid argument fix-up code.

Signature (Visual Basic / VBA)

Public Function LeftJustifyFillFast( _
      ByRef vValue As String _
    , ByVal vWidth As Long _
    , ByRef vFillChar As String _
    ) As String

Code Example

    LeftJustifyFillFast("This is a test.", 20, "-") = "This is a test.-----"
    LeftJustifyFillFast("This is a test.", 10, "-") = "This is a test."

Parameters

Parameter Description
vValue String which is to be left-justified.
vWidth Length to which the string vValue will be filled if its length is less than vWidth.
vFillChar String whose first character will be used to right-fill undersized vValue strings.