What is a neat way to remove different characters from a string? For example, I have the following strings that I need to convert to integers:
($12,990)
$21,434
I use the following code which works fine, but is there a less bulkier way to do the same?
string = string.replace(",", "")
string = string.replace("$", "")
string = string.replace("(", "-")
string = string.replace(")", "")
int(string)
Edit: I am using Python 2.7.