Goto main content

str_pad

Pad a string to a certain length with another string.

STR_PAD

NAME

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

SYNOPSIS

str_pad(string,pad_length,pad_string,pad_type)

PARAMETERS

string
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
String to be inserted in the content.
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

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__.)); 

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.