Expr.str.strip_prefix
methodView source ↗
def strip_prefix(prefix: IntoExpr) -> Expr
Categories: string
Trim string values removing the given prefix
Parameters
parameter
prefixPrefix to remove from the string.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a")
.str.strip_prefix("cb").alias("strip_prefix"))
>>>
┌───────────────────────────────┬─────────────────┐
│ a ┆ strip_prefix │
│ --- ┆ --- │
│ str ┆ str │
╞═══════════════════════════════╪═════════════════╡
│ cba cd ┆ a cd │
│ bx ┆ bx │
│ null ┆ null │
└───────────────────────────────┴─────────────────┘