Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to Strip Characters in python

s = 'This is a sentence with unwanted characters.AAAAAAAA'

print('Strip unwanted characters: {}'.format(s.rstrip('A')))

# Output

# Strip unwanted characters: This is a sentence with unwanted characters.
Source by www.kdnuggets.com #
 
PREVIOUS NEXT
Tagged: #How #Strip #Characters #python
ADD COMMENT
Topic
Name
3+4 =