Remove nonalphabet characters from a string

Syed Naqi

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.

Kamejoin
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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Sorting nonalphabet character (dash) after alphabet characters

From Dev

remove characters from a python string

From Dev

Remove characters from String in Haskell

From Dev

Remove specific characters from a string

From Dev

Remove characters from query string

From Dev

Remove characters from a string then reverse it

From Dev

Remove specific characters from a string

From Dev

Remove certain characters from string

From Dev

Remove repeating characters from string

From Dev

Remove characters from string with sed

From Dev

Remove all characters from the string

From Dev

remove specific characters from a string

From Dev

Remove characters from a string sql

From Dev

Attempting to remove characters from a string

From Dev

Remove last characters from string

From Dev

Remove Invalid Characters from string

From Dev

Remove empty string characters from a javascript string

From Dev

Remove string characters from a string if not matched in an array

From Dev

Remove string characters from a string if not matched in an array

From Dev

How to remove duplicated characters from string in Bash?

From Dev

Remove spaces and special characters from string

From Dev

Remove the last X specific characters from string

From Java

Remove specific characters from a string in Python

From Dev

Remove all special characters from string

From Java

Remove some characters from a string by index (Raku)

From Dev

Regex remove repeated characters from a string by javascript

From Dev

Oracle: remove first 4 characters from a string

From Dev

How to remove escape characters from a JSON String

From Dev

Bash remove first and last characters from a string

Related Related

HotTag

Archive