Python: Split a string with multiple delimiters
47. Split with Multiple Delimiters
Write a Python program to split a string with multiple delimiters.
Note : A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.
Sample Solution:
Python Code:
Sample Output:
['The quick brown', 'fox jumps', 'over the lazy dog.']
Pictorial Presentation:
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to split a string using multiple delimiters such as commas, semicolons, and spaces.
- Write a Python script to tokenize a sentence by splitting it on various punctuation marks and spaces.
- Write a Python program to divide a string into words using a regex that accounts for multiple delimiters.
- Write a Python function to split a string on a combination of characters (e.g., space, comma, dot) and return the resulting list.
Go to:
Previous: Write a Python program to find all adverbs and their positions in a given sentence.
Next: Write a Python program to check a decimal with a precision of 2.
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.