LEFT
returns the leftmost segment of a string, as specified by a segment position argument. The segment position is counted from left to right.
Function category: Text​
To get characters from the right side of a string, use RIGHT
.
LEFT(arg1, arg2)
Arguments | Description |
arg1 | String to be segmented. |
arg2 | Optional. Position where to segment the string. Default is 1. |
Let's say we're given the following response that includes an id string.
{"data": {"ids": {"id_1": "1anb4amca051"}}}
If we are only interested in the first 5 digits of id_1
, use the following function.
# Find 5 digits starting from the leftLEFT(data.ids.id_1, 5)​# Returns 1anb4