Returns a string containing a specified number of characters from the left side of a string
Class: String
Parameters: $string – String from which the leftmost characters are returned
d – Integer indicating how many characters to return
Syntax: $returnString=$left($string, d)
Returns:
• If d<length of $string - A string containing d characters from the left 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 $left method
$s=”SEIKI BATCH SCRIPT” //Set string
$result=$left($s, 5) //Result (= ‘SEIKI’)
message(“Left hand 5 characters of “ + $s + “ are “ + $result) //Display results message
See Also: $right