daft.functions.find#
find #
find(expr: Expression, substr: str | Expression) -> Expression
Returns the index of the first occurrence of the substring in each string.
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | an Int64 expression with the index of the first occurrence of the substring in each string |
Note
The returned index is 0-based. If the substring is not found, -1 is returned.
Examples:
1 2 3 4 | |
╭───────╮
│ x │
│ --- │
│ Int64 │
╞═══════╡
│ 0 │
├╌╌╌╌╌╌╌┤
│ 6 │
├╌╌╌╌╌╌╌┤
│ 3 │
╰───────╯
(Showing first 3 of 3 rows) Source code in daft/functions/str.py
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | |