Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

rstrip in python

text = "     Apple      "
x = txt.rstrip()
>>> '     Apple'
x.rstrip('e')
>>> '  Appl'
x.lstrip()
>>> 'Apple'
Comment

rstrip python3

#python3 program of rstrip method with optional argument
s = "Hello There     "
a = "s"
print(s.rstrip()) # prints s without any spaces at the end
print(s.rstrip(a)) # prints s without any characters of value a at the end
Comment

PREVIOUS NEXT
Code Example
Python :: python selenium send keys enter send 
Python :: python numpy delete element from array 
Python :: python decimal remove trailing zero 
Python :: python program to print the fibonacci sequence 
Python :: check if variable is function python 
Python :: django meta attributes 
Python :: how to change int to four decimal places in python 
Python :: numpy array from list 
Python :: convert a string into a list in Python 
Python :: pandas count empty string values 
Python :: pandas dataframe first rows 
Python :: python parcourir ligne 
Python :: python file modes 
Python :: range(len()) in python 
Python :: how to make a dict from a file py 
Python :: ast python 
Python :: isinstance function python 
Python :: IndentationError: unexpected indent 
Python :: overriding update in serializer django 
Python :: py -m pip 
Python :: blender show python version 
Python :: dense layer keras 
Python :: How to Adjust Title Position in Python 
Python :: beautifulsoup usage 
Python :: formula of factorial 
Python :: apply on dataframe access multiple columns 
Python :: find a key in a dictionary python 
Python :: python range in intervals of 10 
Python :: reset all weights keras 
Python :: Comparison of two csv file and output with differences? 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =