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