Remove Characters
Removes specific characters from a string.
- string
- remove
- characters
Code
def remove_chars(s, chars):
return ''.join(c for c in s if c not in chars)Usage
remove_chars('hello world', 'eo') # Returns: 'hll wrld'Removes specific characters from a string.
def remove_chars(s, chars):
return ''.join(c for c in s if c not in chars)remove_chars('hello world', 'eo') # Returns: 'hll wrld'