Returns a string containing a specified number of characters from the right side of a string
Class: String
Parameters: $string – String from which the rightmost characters are returned
d – Integer indicating how many characters to return
Syntax: $returnString=$right($string, d)
Returns:
• If d<length of $string - A string containing d characters from the right side of $string
• If d≥length of $string - A string containing $string
• If d≤0 - A zero-length string
Remarks: None
Example:
//Example for the string $right method
$s=”SEIKI BATCH SCRIPT” //Set string
$result=$right($s, 6) //Result (= ‘SCRIPT’)
message(“Right hand 6 characters of “ + $s + “ are “ + $result) //Display results message
See Also: $left