RAD function: strpadr

A RAD function that pads a string with trailing blanks until the string is a specified size. If the string is longer than the size desired, it is truncated.

Function

strpadr

Format

$L.void=strpadr($string, $size)

Parameters

The following parameters are valid for the strpadr function:

Parameter Data type Description
$L.void= Not applicable. A syntax requirement only. It does not affect the outcome of the function.
$string String The string being modified.
$size Number The desired size of string.

Examples

$string="Hewlett-Packard"
$size=20
$L.void=strpadr($string, $size)

After execution, the value of $string is Hewlett-Packard(space)(space)(space)(space)(space).

 $string="Hewlett-Packard"
 $size=10
 $L.void=strpadr($string, $size)

After execution, the value of $string is Hewlett-Pa.