polars.internals.expr.string.ExprStringNameSpace.lstrip#

ExprStringNameSpace.lstrip(matches: Optional[str] = None) Expr[source]#

Remove leading whitespace.

Examples

>>> df = pl.DataFrame({"foo": [" lead", "trail ", " both "]})
>>> df.select(pl.col("foo").str.lstrip())
shape: (3, 1)
┌────────┐
│ foo    │
│ ---    │
│ str    │
╞════════╡
│ lead   │
├╌╌╌╌╌╌╌╌┤
│ trail  │
├╌╌╌╌╌╌╌╌┤
│ both   │
└────────┘