Learn R Programming

pystr (version 2.0.0)

pystr_rindex: Find the highest index of a substring.

Description

Like pystr_rfind but raises an error if sub is not found.

Usage

pystr_rindex(str, sub, start = 1, end = nchar(str))

Arguments

str
A character vector.
sub
A character vector.
start
A numeric vector.
end
A numeric vector.

Value

A numeric vector.

References

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

See Also

pystr_index

Examples

Run this code
pystr_rindex("abcxyzabc", "abc")
pystr_rindex("12121212", "12", 4, 6)
## Not run: 
# pystr_rindex("abcxyzabc", "123")
# ## End(Not run)

Run the code above in your browser using DataLab