# https://www.globalsino.com/ICs/ # Remove/repace a character(s) from string using translate() s = 'Yougui Liao' # None for removing NewS1 = s.translate({ord('a'): None}) print("NewS1::: ", NewS1) NewS2 = s.translate({ord('a'): "XYZ"}) print("NewS2::: ", NewS2) # Remove all characters in the defined string (e.g. 'oug' below) NewS3 = s.translate({ord(i): None for i in 'oug'}) print("NewS3::: ", NewS3)