I have some strings that I want to delete some unwanted characters from them.
For example: Adam\'sApple ----> AdamsApple
.(case insensitive)
Can someone help
Any characters in the 2nd argument of the translate method are deleted:
>>> "Adam's Apple!".translate(None,"'!")
'Adams Apple'
NOTE: translate requires Python 2.6 or later to use None for the first argument, which otherwise must be a translation string of length 256. string.maketrans('','') can be used in place of None for pre-2.6 versions.