Expr.str.starts_with
methodView source ↗
def starts_with(prefix: str | Expr) -> Expr
Categories: string
Evaluate if the string start with.
Parameters
parameter
prefixThe suffix to search for.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a")
.str.starts_with("a").alias("starts_with"))
>>>
┌──────┬────────────┐
│ a ┆ start_with │
│ --- ┆ --- │
│ str ┆ bool │
╞══════╪════════════╡
│ a ┆ true │
│ ab ┆ true │
│ b ┆ false │
│ xaby ┆ false │
│ null ┆ null │
└──────┴────────────┘