Skip to content

string_pad

Hyomoto edited this page Jun 13, 2021 · 2 revisions
Jump To Go Back Arguments

string_pad( string, spaces, left?, *character )

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"

Arguments

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
Clone this wiki locally