Left()
Returns a substring from beginning of the input string, with a length specified by the count argument.
Left( string=string, count=number );
Returns: String
| Argument | Description |
|---|---|
|
string
string,
required
|
edit
A string or a variable that contains one. |
|
count
number,
required
|
edit
A non-zero integer. A positive value of n will return n characters from the beginning of the string. A negative value of n will return (length - n) characters from the beginning of the string. |
Examples
editdump( left('abcd',3) ); // abc
dump( left("Peter", -1) ); // Pete
See also
- Strings
- Right()
- string.left()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)