Returns a transform that extracts a fixed-width substring from a string
column. The result can be passed as the transform argument to
il_compare() or il_block_on(), and composed with other transforms
via il_transform(). On DuckDB and PostgreSQL, the computation is
pushed into SQL.
Examples
tf <- il_substr(1, 3)
tf(c('Johnson', 'Smith', 'Lee'))
#> [1] "Joh" "Smi" "Lee"
# Use for blocking on the first 3 characters of a name
spec <- il_spec() |>
il_block_on(last_name, .transform = il_substr(1, 3))
