How to remove parentheses from string [duplicate]

This:

document = re.sub(r"(\)", " ", document)

or this:

document = re.sub(r"()", " ", document)

do not work for me.

So how can I simply remove the parentheses from a text.

For example this:

document = "(Hello World)"

to become this:

document = "Hello World"

Leave a Comment