Supported in: Batch, Streaming
Extract substring.
Expression categories: Numeric
Output type: String
Argument values:
string
start
length
string | start | length | Output |
---|---|---|---|
hello, world | 1 | 5 | hello |
hello, world | 8 | 5 | world |
hello, world | -5 | 5 | world |
Description: When no length is provided, the substring runs to end of string. Argument values:
string
start
string | start | Output |
---|---|---|
hello, world | 1 | hello, world |
hello, world | 8 | world |
hello, world | -5 | world |
Description: In case of nulls, the output is always null. Argument values:
string
start
length
string | start | length | Output |
---|---|---|---|
null | 1 | 5 | null |
hello, world | null | 5 | null |
hello, world | 1 | null | null |
null | null | null | null |
Description: When length is longer than remaining sub string, the output is the sub string until the end of the string. Argument values:
string
start
length
string | start | length | Output |
---|---|---|---|
hello, world | -5 | 10 | world |
hello, world | 1 | 20 | hello, world |
hello, world | 12 | 5 | d |
hello, world | 13 | 5 | empty string |
hello, world | 20 | 5 | empty string |
hello, world | 12 | -5 | empty string |