Liberty BASIC Help Online |
LEFT$( s$, n )
LEFT$(string, number)
Description:
This function returns from the string, string variable, or string expression string the specified number of characters starting from the left. If string is "hello there", and number is 5, then "hello" is the result.
Usage:
[retry]
input "Please enter a sentence>"; sentence$
if sentence$ = "" then [retry]
for i = 1 to len(sentence$)
print left$(sentence$, i)
next i
Produces:
Please enter a sentence>That's all folks!
T
Th
Tha
That
That'
That's
That's_
That's a
That's al
That's all
That's all_
That's all f
That's all fo
That's all fol
That's all folk
That's all folks
That's all folks!
Note: If number is zero or less, then "" (an empty string) will be returned. If number is greater than or equal to the number of characters in string, then string will be returned.
Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/