25.104.1. LEFT Details

[<<<] [>>>]

left(x,y) cuts out a substring of y characters from the left of the string x. If the first argument is not defined the result is also undef. Otherwise the first argument is converted to string and the second ar-gument is converted to integer value.

If the second argument is not defined or has negative value it is treated as numeric zero and as such the result string will be empty string.

For compatibility reasons you can append a dollar ($) sign to the end of the function identifier.

Example

a$ = _
"superqualifragilisticexpialidosys"
print "*",left(a$,undef),"*"
print "*",left(a$,7),"*"
print "*",left(a$,-6),"*"
print "*",left(a$,0),"*"
print left(undef,"66")

will print

**
*superqu*
**
**
undef

[<<<] [>>>]