Skip to main content
Version: 1.4.0

Expr.str.to_titlecase

def to_titlecase() -> Expr

Categories: string

Uppercase the first character and lowercase all the others ones of a string.

Examples

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a").str.to_titlecase().alias("titlecase"))
>>>
┌──────┬───────────┐
│ a ┆ titlecase │
------
strstr
╞══════╪═══════════╡
│ ab ┆ Ab │
│ Ab ┆ Ab │
│ AB ┆ Ab │
│ aB ┆ Ab │
│ null ┆ null │
└──────┴───────────┘