Top | Up (String) | < Previous (PAGE NAME) | Next (PAGE NAME) >
Extract characters from the left side of a string
LEFT$ string$, length% OUT substring$
Parameter | Description |
---|---|
string$ | A string |
length% | The number of characters to extract. Can’t be less than 0. If greater than the length of string$ , the entire string is returned. |
Output | Description |
---|---|
substring$ | The leftmost length% characters of string$ |
LEFT$
always returns a new string, even if length%
is greater than or equal to the length of string$
.
PRINT LEFT$("TEST",2) ' TE
PRINT LEFT$("AAAAA",200) ' AAAAA
Error | Cause |
---|---|
Out of range | length% is less than 0 |
Top | Up (String) | < Previous (PAGE NAME) | Next (PAGE NAME) >