substring

Options start (from 1) and length, in Unicode scalar values.

ScalarDeterministic

Flags

Flag Value
Kind scalar
Nulls a null argument gives null
Deterministic yes
Order matters no
Decomposable no

Example

A pipeline from the language's tested corpus that uses substring, over the example tables.

Hint
from customers
derive {full = concat(name, "-", region ?? "none"), r = replace(name, "c", "C"), parts = split(name, "0"), mid = substring(name, start: 2, length: 2)}

In a plan:

JSON
{
  "args": [
    {
      "col": 1
    }
  ],
  "fn": "substring",
  "options": {
    "length": 2,
    "start": 2
  }
}