You can use the str.split
method: string.split('__')
>>> "MATCHES__STRING".split("__")
['MATCHES', 'STRING']
More Related Contents:
- Splitting on last delimiter in Python string?
- Python split string into multiple string [duplicate]
- How to split strings inside a list by whitespace characters
- Convert string to list. Python [string.split() acting weird]
- Convert list of strings to dictionary
- What does += mean in this context?
- Split a Pandas column of lists into multiple columns
- Split Strings into words with multiple word boundary delimiters
- How to convert list to string [duplicate]
- How would you make a comma-separated string from a list of strings?
- How to split elements of a list?
- Loop “Forgets” to Remove Some Items [duplicate]
- How can I split and parse a string in Python?
- How do I split a multi-line string into multiple lines?
- How to split strings into text and number?
- Reading a text file and splitting it into single words in python
- Confused about __str__ on list in Python [duplicate]
- How do I convert a list into a string with spaces in Python?
- Perform a string operation for every element in a Python list
- removing newlines from messy strings in pandas dataframe cells?
- How to convert a string of space- and comma- separated numbers into a list of int? [duplicate]
- Change a string of integers separated by spaces to a list of int
- Sort list of strings by a part of the string
- How to create a list with the characters of a string? [duplicate]
- Python: How to check a string for substrings from a list? [duplicate]
- Convert a columns of string to list in pandas
- How to apply __str__ function when printing a list of objects in Python [duplicate]
- How do I split a string into a list of words?
- How does str(list) work?
- Python split string in moving window