Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 36)
36.
How can you remove all occurrences of a specific character from a string?
remove_char(string, 'x')
string = string.replace('x', '')
string.remove('x')
remove_occurrences(string, 'x')
Answer: Option
Explanation:
To remove all occurrences of a specific character from a string, use the replace() method.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.