Returns a left-aligned copy of a string, padded on the right with Unicode characters for a specified total length
Class: String
Parameters: $string – String to extend
d – Integer specifying required string length
$ch – Padding string
Syntax: $returnString=$padright($string, d, $ch)
Returns:
• If d≤length of $string - A string identical to $string
• If d>length of $string - A string containing $string but left aligned and padded to the right with as many part or whole $ch strings as required to create a length of d
Remarks: None
Example:
//Example for the string $padright method
$s=”SEIKI BATCH SCRIPT” //Set string
$padstring=”abc”
$result=”|” + $padright($s, 25, $padstring) + “|” //Result (= ‘|SEIKI BATCH SCRIPTabcabca|”)
message(“Right padding of “ + $s + “ is “ + $result) //Display results message
See Also: $pad