daft.functions.startswith#
startswith #
startswith(expr: Expression, prefix: str | Expression) -> Expression
Checks whether each string starts with the given prefix in a string column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr | Expression | The expression to check. | required |
prefix | str | Expression | The prefix to search for as a literal string, or as a column to pick values from | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | a Boolean expression indicating whether each value starts with the provided prefix |
Examples:
1 2 3 4 | |
╭──────────┬───────╮
│ x ┆ match │
│ --- ┆ --- │
│ String ┆ Bool │
╞══════════╪═══════╡
│ geftdaft ┆ false │
├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ lazy ┆ false │
├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ daft.io ┆ true │
╰──────────┴───────╯
(Showing first 3 of 3 rows) Source code in daft/functions/str.py
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | |