Skip to main content
Version: 1.5.0

Expr.str.strip_prefix

def strip_prefix(prefix: td_IntoExpr) -> Expr

Categories: string

Trim string values removing the given prefix

Parameters

parameter
prefix

Prefix 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 │
------
strstr
╞═══════════════════════════════╪═════════════════╡
│ cba cd ┆ a cd │
│ bx ┆ bx │
│ null ┆ null │
└───────────────────────────────┴─────────────────┘