Use the str.split method:

>>> "MATCHES__STRING".split("__")
['MATCHES', 'STRING']
Answer from adamk on Stack Overflow
🌐
W3Schools
w3schools.com β€Ί Python β€Ί ref_string_split.asp
Python String split() Method
Remove List Duplicates Reverse ... Syllabus Python Study Plan Python Interview Q&A Python Training ... The split() method splits a string into a list....
🌐
Python
docs.python.org β€Ί 3.3 β€Ί library β€Ί stdtypes.html
4. Built-in Types β€” Python 3.3.7 documentation
If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result. ... Split the string at the first occurrence of sep, and return a 3-tuple containing the part before the separator, the separator itself, and the part after the separator.
Discussions

split() function splitting every character?
You call c.split() but don't do anything with the result. c continues to refer to the original, unsplit, string; so c[0] gives you the first character of that string. You possibly mean c = c.split(), but it would be better to assign it to a new variable. More on reddit.com
🌐 r/learnpython
20
44
April 27, 2022
Split a string by a delimiter in Python - Stack Overflow
Consider the following input string: 'MATCHES__STRING' I want to split that string wherever the "delimiter" __ occurs. This should output a list of strings: ['MATCHES', 'STRING'] To spli... More on stackoverflow.com
🌐 stackoverflow.com
python - How do I split a string into a list of characters? - Stack Overflow
How do I split a string into a list of characters? str.split does not work. "foobar" β†’ ['f', 'o', 'o', 'b', 'a', 'r'] More on stackoverflow.com
🌐 stackoverflow.com
Trying to understand string split()
When you're calling split() (without arguments) the split will be done on any number of spaces. It is not the same as calling split(' '). '-a-b'.split('-') # returns ['', 'a', 'b'] ' a b'.split(' ') # returns ['', 'a', 'b'] ' a b'.split() # returns ['a', 'b'] More on reddit.com
🌐 r/learnpython
7
0
January 31, 2024
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί python-string-split
Python split() Method - GeeksforGeeks
July 1, 2026 - It returns the resulting parts as a list of strings. ... Explanation: s.split(',') splits the string s at every comma and returns a list of the parts ['one', 'two', 'three'].
🌐
Mimo
mimo.org β€Ί glossary β€Ί python β€Ί string-split-method
Learn Python's String Split Method, Simplify Text Processing
Master Python's split() method to divide strings into lists with ease. Explore examples for data parsing, text tokenization, and file processing effectively.
🌐
Python Morsels
pythonmorsels.com β€Ί string-split-method
The string split method in Python - Python Morsels
September 27, 2024 - Strings can be split by a substring separator. Usually the string split is called without any arguments, which splits on any whitespace. Trey Hunner Sept. 27, 2024 2 min read 01:48 video Python 3.10β€”3.14
Find elsewhere
🌐
Hyperskill
hyperskill.org β€Ί university β€Ί python β€Ί split-in-python
Python split(): Split Strings by Delimiter with Examples
June 5, 2026 - To use the split() function, provide the delimiter as an argument within the parentheses. The delimiter can be any character or substring that you want to use as a separator. The function searches for occurrences of the delimiter within the string and breaks it down at each occurrence. # Using whitespace as a delimiter text = "Hello World! Welcome to Python!" result = text.split() print(result) # Output: ['Hello', 'World!', 'Welcome', 'to', 'Python!'] # Using a comma as a delimiter fruits = "apple,banana,orange" result = fruits.split(",") print(result) # Output: ['apple', 'banana', 'orange']
🌐
IONOS
ionos.com β€Ί digital guide β€Ί websites β€Ί web development β€Ί python split
How to split strings with Python split - IONOS
February 1, 2023 - Set maxsplit to 2 and run Python split for a double split. This is the code: colors = "blue, red, yellow, orange" print(colors.split(", ", 2)) ... While the default variant is to split using commas or spaces, you can also split strings within specific words. In the following example, we use animal names again and split them at the letter a.
🌐
ReqBin
reqbin.com β€Ί code β€Ί python β€Ί nxrhfweu β€Ί python-split-string-example
How do I split a string in Python?
December 20, 2022 - There are at least five ways to split a string in Python. The simplest and most commonly used method is a string.split(), which by default splits a Python string into a list of substrings using spaces, tabs, and line breaks.
🌐
OpenStax
openstax.org β€Ί books β€Ί introduction-python-programming β€Ί pages β€Ί 8-5-splitting-joining-strings
8.5 Splitting/joining strings - Introduction to Python Programming | OpenStax
March 13, 2024 - A string in Python can be broken into substrings given a delimiter. A delimiter is also referred to as a separator. The split() method, when applied to a string, splits the string into substrings by using the given argument as a delimiter.
🌐
Python Reference
python-reference.readthedocs.io β€Ί en β€Ί latest β€Ί docs β€Ί str β€Ί split.html
split β€” Python Reference (The Right Way) 0.1 documentation
returns [β€˜1’, β€˜2’, β€˜3’]). Splitting an empty string with a specified separator returns [β€˜β€™].
🌐
YouTube
youtube.com β€Ί watch
🐍 Python Tutorial #27: Splitting and Joining Strings - YouTube
In this quick Python tutorial, we cover two essential string methods: split() and join().You’ll learn:βœ… How to use split() to turn strings into listsβœ… How to...
Published: June 29, 2025
🌐
Programiz
programiz.com β€Ί python-programming β€Ί methods β€Ί string β€Ί split
Python String split()
The split() method breaks down a string into a list of substrings using a chosen separator. In this tutorial, we will learn about the Python String split() method with the help of examples.