-
Notifications
You must be signed in to change notification settings - Fork 1
string_pad
Hyomoto edited this page Jun 13, 2021
·
2 revisions
Jump To | Go Back |
Arguments |
---|
Returns: string
Throws: InvalidArgumentType
Attempts to pad the given string the specified number of spaces. By default spaces " " will be added, but this can be changed by providing character(s) to use. If left is true, padding is added to the left side of the string, otherwise it will be added to the right. If a non-string is provided as the string or character, or a non-number is given for spaces or left? then InvalidArgumentType will be thrown.
string_justify( "8125", 6, fa_right, "0" );
Output: "008125"
Name | Type | Purpose |
---|---|---|
string | string |
The string to justify |
spaces | int |
The number of spaces to justify to |
left? | bool |
The alignment to use |
*character | string |
optional: The character to use for spacing |
Devon Mullane 2020