Check the suffix of a string.

Description

Return TRUE if the string str ends with the specified suffix, otherwise return FALSE.

Usage

1
pystr_endswith(str, suffix, start = 1, end = nchar(str))

Arguments

str

A character vector.

suffix

A character vector.

start

A numeric vector.

end

A numeric vector.

Details

With optional start, test beginning at that position. With optional end, stop comparing at that position.

Value

A logical vector.

References

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

See Also

pystr_startswith

Examples

1
2
3
pystr_endswith("selfie.jpg", ".jpg")
pystr_endswith("selfie.jpg", ".png")
pystr_endswith("hello world", "ello", 1, 5)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.