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
RIGHT
Dan Gorman edited this page Nov 29, 2018
·
3 revisions
RIGHT
returns the rightmost segment of a string, as specified by a segment position argument.
RIGHT(arg1, arg2)
-
arg1
is the string to be segmented -
arg2
is optional, and is the point from the right 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 last 5 digits of the id, we can get them with RIGHT
:
RIGHT(data.ids.id_1, 5)
which returns ca051
.
To get characters from the left side of a string, use LEFT
Unlike LEFT
, the segment position argument for RIGHT
is counted from right to left, as opposed to left to right.