Left
Use the Left function to return a specified number of characters from the
left side of a string.
The Left function returns a variant(string). To determine the number of
characters in a string, use the Len
function.
Syntax
Left(string, length)
Argument | Description |
---|---|
string |
String expression from which characters are returned. If
string contains Null, then Null is returned. |
length |
Variant (Long). Numeric expression indicating how many characters to return. If 0, then a zero-length string ("") is returned. If greater than or equal to the number of characters in string, then the entire string is returned. |
Use the LeftB
function with byte data contained in a string. Instead of
specifying the number of characters to return, length
specifies the number
of bytes.
Example
This example returns "To the left":
Left("To the left of this sentence",11)