I have a string like "lake1!"
and I want to remove non nonalphabet characters from this string.
How can I do that? Also, this is just an example but in general if have some string how can I remove nonalphabet characters from it?
For example: "lake1!"
should return "lake"
with 1
and !
removed.
word = 'lake1!'
new_word = ''
for char in word:
if char.isalpha():
new_word += char
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments