Left

Extracts characters from the left end of a string of characters (the first characters).

Syntax

Left(string, num_chars)
Gauche(string, num_chars)
string = character string from which you want to extract the part on the left
num_chars = the number of characters to extract

Remarks

If num_chars is less than or equal to zero, the function will return an empty string.
If num_chars is greater than the number of characters in the string, then the string will be returned unchanged.

See also: Right if you want to extract the right part of the string, or Mid to extract a sub-string. If you want characters before a delimiter see StrBefore.

Examples

Left("banana", 4) = "bana"
Left("green", 6) = "green"
Left("fruit", -1) = "" (empty string)

Classification

Strings