Search code snippets, questions, articles...

Python - String ,remove,delete,replace,extract numbers from string

# remove numbers from string
s = '12abcd405'
result = ''.join([i for i in s if not i.isdigit()])
Output
'abcd'

Remove numbers from a string

Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet