programming-examples/python/String/Python program to strip a set of characters from a string.py
2019-11-15 12:59:38 +01:00

9 lines
315 B
Python

def strip_chars(str, chars):
return "".join(c for c in str if c not in chars)
print("\nOriginal String: ")
print("The quick brown fox jumps over the lazy dog.")
print("After stripping a,e,i,o,u")
print(strip_chars("The quick brown fox jumps over the lazy dog.", "aeiou"))
print()