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
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 | |