Skip to content

Returns string values in reversed order

Source code

Description

Returns string values in reversed order

Usage

<Expr>$str$reverse()

Value

Expr

Examples

library("polars")

df = pl$DataFrame(text = c("foo", "bar", NA))
df$with_columns(reversed = pl$col("text")$str$reverse())
#> shape: (3, 2)
#> ┌──────┬──────────┐
#> │ text ┆ reversed │
#> │ ---  ┆ ---      │
#> │ str  ┆ str      │
#> ╞══════╪══════════╡
#> │ foo  ┆ oof      │
#> │ bar  ┆ rab      │
#> │ null ┆ null     │
#> └──────┴──────────┘