function

str_pad . string . sncode

VERSIONlatest Pad a string to a certain length with another string.

STR_PAD(1e)

NAME

str_pad - Pad a string to a certain length with another string.

SYNOPSIS

str_pad(str,pad_length,pad_string,pad_type)

PARAMETERS

str
The input string.
pad_length
If the value of pad_length is negative, less than, or equal to the length of the input string, no padding takes place.
pad_string
 
pad_type
Optional argument pad_type can be 0 : pad right, 1 : pad left, 2 : pad both. If pad_type is not specified it is assumed to be pad right.

RETURN

Returns the padded string.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{str_pad("pierre",10)}}. return res=pierre    .));
res={_{str_pad("pierre",10, "-=", 1)}}. return res=-=-=pierre.));
res={_{str_pad("pierre",10, "_", 2)}}. return res=__pierre__.));

AUTHOR

Written by Pusnei Sergey, <sergey@sednove.com>