The following example will help determine the difference:
"abccba".partition("b")
# => ["a", "b", "ccba"]
"abccba".rpartition("b")
# => ["abcc", "b", "a"]
Thus, the difference is that it rpartitionsearches for the rightmost entry, and not the leftmost.
source
share