Split String With Multiple Delimiters In Python

[Solved] Split String With Multiple Delimiters In Python | Perl - Code Explorer | yomemimo.com
Question : how to split a string in python with multiple delimiters

Answered by : cooperative-crab-55za13q1fitq

>>> a='Beautiful, is; better*than\nugly'
>>> import re
>>> re.split('; |, |\*|\n',a)
['Beautiful', 'is', 'better', 'than', 'ugly']

Source : https://stackoverflow.com/questions/4998629/split-string-with-multiple-delimiters-in-python | Last Update : Tue, 16 Jun 20

Answers related to split string with multiple delimiters in python

Code Explorer Popular Question For Perl