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
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | |