LEFT(string, length)
LEFTB(string, length)
Description
LEFT returns a string containing a specified number of characters from the left end of a string. The required parameter, string, is any valid string expression. The required parameter, length, is any valid numeric expression, if length is 0, an empty string ("") is returned, if length is greater than the size of string, the entire string is returned.
LEFTB is a strict bytewise version of LEFT. When used on the Unicode strings of Windows CE devices, it will return any partial character as a normal character.
Example
REM LEFT Example
'LEFT returns substring from string left end
DIM Wendy, Eric
Wendy = "Testaburger"
Eric = "Cartman"
PRINT "The LEFT 4 of " & Wendy & ": " _
& LEFT(Wendy, 4)
PRINT "The LEFT 4 of " & Eric & ": " _
& LEFT(Eric, 4)
Output
The LEFT 4 of Testaburger: Test
The LEFT 4 of Cartman: Cart
Related Items
LEN, MID, RIGHT