left
Modified on Wed, 16 Aug 2023
Description
Return a specified number of characters from the beginning of a string
Syntax
left(text, length)
Parameters
Input Parameter | Type | Description |
---|---|---|
text | string | The input string |
length | number | The number of characters to return from the beginning |
Return value
Type |
---|
string |
Sample
Example | Result | Description |
---|---|---|
left("abcd", 2) | "ab" | The substring containing the leftmost characters |
left("abcd", 5) | "abcd" | left function with length greater than the string length |
left("", 5) | "" | left function for an empty string |
To view all the String functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article