Learn R Programming

pystr (version 2.0.0)

pystr_rsplit: Right split a string.

Description

Return a list of character vectors of the words in the string, using sep as the delimiter string.

Usage

pystr_rsplit(str, sep = " ", maxsplit = nchar(str) - 1)

Arguments

str
A character vector.
sep
A character string.
maxsplit
A numeric vector.

Value

A list of character vectors.

Details

If maxsplit is given, at most maxsplit splits are done, the rightmost ones. If sep is not specified, any whitespace string is a separator. Except for splitting from the right, pystr_rsplit behaves like pystr_split.

References

https://docs.python.org/3/library/stdtypes.html#str.rsplit

See Also

pystr_split

Examples

Run this code
pystr_rsplit("a--b--c", "--")
pystr_rsplit("a--b--c", "--", 1)

Run the code above in your browser using DataLab