This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
LEFT
Dan Gorman edited this page Nov 29, 2018
·
3 revisions
LEFT
returns the leftmost segment of a string, as specified by a segment position argument.
LEFT(arg1, arg2)
-
arg1
is the string to be segmented -
arg2
is optional, and is the point at which to segment the strings (defaults to 1)
Let's say we're given a response with an id:
{
"data":{
"ids":{
"id_1": "1anb4amca051"
}
}
}
If we are only interested in the first 5 digits of the id, we can get them with LEFT
:
LEFT(data.ids.id_1, 5)
which returns 1anb4
.
To get characters from the right side of a string, use RIGHT
Unlike RIGHT
, the segment position argument for LEFT
is counted from left to right, as opposed to right to left.