8.3.6 Left (return characters from the left side of a string)
- Purpose
-
Returns a substring containing a specified number of characters from the left side of a string.
- Syntax
Left (String, Length)
- Arguments
-
- String
-
Specify the string itself or a variable that stores this value.
- Length
-
Specify the number of characters to retrieve from the specified string, or write a variable that stores this value.
If you specify 0, a zero-length string ("") is returned. If you specify a value greater than all the characters in the string you set in String, the Left command returns all the characters in the specified string.
- Description
-
The Left command returns a substring containing a specified number of characters from the left side of a specified string.
One two-byte-character and one one-byte-character are both handled as one character. To check the length of the string, use the Len command.
- Example
' This code stores "ABCD" in variable string1. Dim string1 string1 = Left ("ABCDEFGH", 4)
- JP1/Script version
-
Supported from JP1/Script 01-00.