44 Views

20th August 2020

Split By Multiple Delimiters Python

How to break a string with multiple delimiters in python?

Answers

20th August 2020

Answered by rushi chowdary

b= ‘something, is; better*than\nnothing’

import re

print(re.split('; |, |\*|\n', b)

Output: ['something', 'is', 'better', 'than', 'nothing']

Write your answer
Request a Free Demo

Meet the Expert Who Can Kickstart Your Career