tabsdata.tableframe.expr.string.ExprStringNameSpace.strip_chars#

ExprStringNameSpace.strip_chars(characters: td_expr.IntoExpr = None) td_expr.Expr[source]#

Trim string values.

Parameters:

characters – Characters to trim from start and end of the string. All characteres in the given string are removed, regardless the order. Default is whitespace.

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a")
      .str.strip_chars("a ").alias("strip_chars"))
>>>
┌─────────────────────────────────┬─────────────┐
│ a                               ┆ strip_chars │
│ ---                             ┆ ---         │
│ str                             ┆ str         │
╞═════════════════════════════════╪═════════════╡
│ acba cda                      … ┆ cba cd      │
│    xy z                         ┆ xy z        │
│ null                            ┆ null        │
└─────────────────────────────────┴─────────────┘