strs_lstrip: Left strip characters from a string

View source: R/lstrip.R

strs_lstripR Documentation

Left strip characters from a string

Description

strs_lstrip removes leading characters (spaces by default) from each element of a character vector. It is similar to Python's str.lstrip() method.

Usage

strs_lstrip(string, chars = NULL)

Arguments

string

A character vector where each element is a string to be left-stripped.

chars

An optional string of characters to be removed from the beginning of each element. If NULL, whitespace is removed.

Value

A character vector of the same length as string, with specified characters removed from the beginning of each element.

See Also

Python str.lstrip() documentation

Examples

strs_lstrip("    hello world")
strs_lstrip("xxxyhello world", chars = "xy")

strs documentation built on Sept. 11, 2024, 6:44 p.m.