logo-MindMajix
PostPythonPython
v
veerubhotla sowmithri

Posted on 24th July 2024|56 views

0
votes

Split By Multiple Delimiters Python

How to break a string with multiple delimiters in python?

1 answers
Answers
P
rushi chowdary

Posted on 24th July 2024| views

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

import re

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

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

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number