Skip to content

Strip leading characters

Source code

Description

Remove leading characters.

Usage

<Expr>$str$strip_chars_start(matches = NULL)

Arguments

matches The set of characters to be removed. All combinations of this set of characters will be stripped. If NULL (default), all whitespace is removed instead. This can be an Expr.

Details

This function will not strip any chars beyond the first char not matched. strip_chars_start() removes characters at the beginning of the string only. Use strip_chars() and strip_chars_end() to remove characters from the left and right or only from the right respectively.

Value

Expr of String lowercase chars

Examples

library(polars)

df = pl$DataFrame(foo = c(" hello", "\tworld"))
df$select(pl$col("foo")$str$strip_chars_start(" hel rld"))
#> shape: (2, 1)
#> ┌───────┐
#> │ foo   │
#> │ ---   │
#> │ str   │
#> ╞═══════╡
#> │ o     │
#> │    world │
#> └───────┘