Use regex to replace characters in the list in Python. Two of such functions within
Example replace character in the list in Python
Simple example code removes multiple characters from a string. Removing “e”, “l’, and “p” char from given string.
You have to import the re module for this example.
import re print(re.sub("e|l|p", "", "Hello Python Developers"))
Do comment if you have any doubts and suggestions on this Python char topic.
Note: IDE: PyCharm 2021.1.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.