remove char form string python code example
Example 1: remove a char in a string python
s = 'abc12321cba'
print(s.replace('a', ''))
=>s
out:bc12321cb
Example 2: how to delete specific char in string python
a_string = a_string.replace("d", "")
s = 'abc12321cba'
print(s.replace('a', ''))
=>s
out:bc12321cb
a_string = a_string.replace("d", "")