• split() can select the position in a string from the front to divide.
  • rsplit() can select the position in a string from the back to divide.
test = "1--2--3--4--5"

print(test.split("--", 2)) # Here
print(test.rsplit("--", 2)) # Here

Output:

['1', '2', '3--4--5'] # split()
['1--2--3', '4', '5'] # rsplit()

In addition, if split() and rsplit() have no arguments as shown below:

test = "1 2  3   4    5"

print(test.split()) # No arguments
print(test.rsplit()) # No arguments

They can divide a string by one or more spaces as shown below:

['1', '2', '3', '4', '5'] # split()
['1', '2', '3', '4', '5'] # rsplit()
Answer from Super Kai - Kazuya Ito on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_string_rsplit.asp
Python String rsplit() Method
Python Examples Python Compiler ... Plan Python Interview Q&A Python Training ... The rsplit() method splits a string into a list, starting from the right....
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ reference โ€บ api โ€บ pandas.Series.str.rsplit.html
pandas.Series.str.rsplit โ€” pandas 3.0.5 documentation
>>> s.str.split(expand=True) 0 1 2 3 4 0 this is a regular sentence 1 https://docs.python.org/3/tutorial/index.html NaN NaN NaN NaN 2 NaN NaN NaN NaN NaN ยท For slightly more complex use cases like splitting the html document name from a url, a combination of parameter settings can be used. >>> s.str.rsplit("/", n=1, expand=True) 0 1 0 this is a regular sentence NaN 1 https://docs.python.org/3/tutorial index.html 2 NaN NaN
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-string-rsplit-method
Python String rsplit() Method - GeeksforGeeks
April 21, 2025 - rsplit() method in Python is used to split a string from the right (the end of the string) based on a specified separator.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python โ€บ strings โ€บ .rsplit()
Python | Strings | .rsplit() | Codecademy
October 7, 2023 - The .rsplit() method in Python is a string method that splits a string into a list of substrings from the right end of the string based on a specified delimiter.
๐ŸŒ
Python Reference
python-reference.readthedocs.io โ€บ en โ€บ latest โ€บ docs โ€บ str โ€บ rsplit.html
rsplit โ€” Python Reference (The Right Way) 0.1 documentation
Returns a list of the words in the string, separated by the delimiter string (starting from right) ยท str. rsplit([sep[, maxsplit]])
๐ŸŒ
Jobtensor
jobtensor.com โ€บ Tutorial โ€บ Python โ€บ en โ€บ String-Methods-rsplit
Python String rsplit(), Definition, Syntax, Parameters, Examples | jobtensor
The rsplit() method splits a string into a list, starting from the right. If no "maxsplit" is specified, this method will return the same as the split() method.
Find elsewhere
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ string โ€บ rsplit
Python String rsplit()
rsplit() breaks the string at the separator starting from the right and returns a list of strings.
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ builtins โ€บ stdtypes.html
Built-in Types โ€” Python 3.14.7 documentation
Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done, the rightmost ones. If sep is not specified or None, any whitespace string is a separator.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ rsplit_method.htm
Python String rsplit() Method
If we does not provide any delimiter, the rsplit() method splits the string based on whitespace characters by default.
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ python โ€บ standard-library โ€บ str โ€บ rsplit
Python str rsplit() - Split String From Right | Vultr Docs
December 27, 2024 - The str.rsplit() method in Python splits a string into a list, starting the splits from the right end of the string.
๐ŸŒ
GUVI
guvi.in โ€บ hub โ€บ python-built-in-functions-tutorial โ€บ python-string-rsplit
How does rsplit() split strings?
The Python rsplit() string method is used to split the string on the basis of the given separator from the right side of the string.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-pandas-reverse-split-strings-into-two-list-columns-using-str-rsplit
Python | Pandas Reverse split strings into two List/Columns using str.rsplit() - GeeksforGeeks
July 11, 2025 - Example #1: Splitting string from right side into list In this example, the string in the Team column is split at every occurrence of "t". n parameter is kept 1, hence the max number of splits in the same string is 1. Since rsplit() is used, the string will be separated from the right side.
๐ŸŒ
Greg's Data Projects
greganthonydamico.com โ€บ f โ€บ the-python-string-methods-split-and-rsplit
The Python String Methods .split() and .rsplit()
July 26, 2022 - If you've coded in Python, you know that strings (or, strictly, str) is a data / object type with its own methods. And you've probably come across the useful method .split(), which returns a list of the parts of a string...
๐ŸŒ
DEV Community
dev.to โ€บ hyperkai โ€บ rsplit-in-python-44f4
rsplit in Python - DEV Community
October 18, 2025 - str.rsplit() and bytes.rsplit() or bytearray.rsplit() can split the string and bytes or bytearray respectively from the right to the left as shown below:
๐ŸŒ
DEV Community
dev.to โ€บ itsmycode โ€บ python-string-rsplit-74j
Python String rsplit() - DEV Community
January 25, 2022 - The Python String rsplit() method is a built-in function that splits the string at the specified separator from the right side and returns a list of strings.
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ what-is-the-numpycharrsplit-function-in-python
What is the numpy.char.rsplit() function in Python?
The numpy.char.rsplit() function in Python is used to return a list of words in the string of an array of strings using a sep as the delimiter string.
๐ŸŒ
Python Morsels
pythonmorsels.com โ€บ string-split-method
The string split method in Python - Python Morsels
September 27, 2024 - >>> line.rsplit("|", maxsplit=1) ['Rubber duck|5', '10'] This splits from the right-hand side of the string. Or you can think of it as a reverse split, splitting from the end of the string.