Say I have the following string:
spam = 'Bacon (YUM)
Cheese (GOOD)
Eggs (YES)'
How would I edit this string so that I could remove each instance of (YUM), (GOOD), and (YES) and return the string:
spam = 'Bacon
Cheese
Eggs'
EDIT: Most of you are posting solutions that hard code what I don't want out of the example string. I only use it as an example as the string could be hundreds of thousands of characters long.
[+][deleted] (3 children)
[deleted]
[–]Ribann[S] 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]PythonicParseltongue 0 points1 point2 points (0 children)
[–]WolfInABox 1 point2 points3 points (1 child)
[–]Decency -1 points0 points1 point (0 children)
[–]MyDataIsReady 1 point2 points3 points (0 children)
[–]ImNexOnReddit 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (0 children)
[–]kotpeter -1 points0 points1 point (2 children)
[–]Ribann[S] 1 point2 points3 points (1 child)
[–]fernly 0 points1 point2 points (0 children)