polars.Expr.str.to_titlecase#

Expr.str.to_titlecase() Expr[source]#

Transform to titlecase variant.

Examples

>>> df = pl.DataFrame(
...     {"sing": ["welcome to my world", "THERE'S NO TURNING BACK"]}
... )
>>> df.select(pl.col("sing").str.to_titlecase())
shape: (2, 1)
┌─────────────────────────┐
│ sing                    │
│ ---                     │
│ str                     │
╞═════════════════════════╡
│ Welcome To My World     │
│ There's No Turning Back │
└─────────────────────────┘