Answers for "how to delete both parenthases in python"

0

how to remove text in brackets of python

>>> import re 
>>> x = "This is a sentence. (once a day) [twice a day]"
>>> re.sub("[([].*?[)]]", "", x)
'This is a sentence.  '
Posted by: Guest on May-31-2020
0

remove all parentheses from string python

>>> table = str.maketrans({"(":None, ")":None})
Posted by: Guest on February-20-2020

Code answers related to "how to delete both parenthases in python"

Python Answers by Framework

Browse Popular Code Answers by Language