ID EN
Built-in Types

rpartition

Python 3.11

Split the string at the last occurrence of sep, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return a 3-tuple containing two empty strings, followed by the string itself.

Syntax

PYTHON
str.rpartition(sep)