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 :: Interfaces 
Python :: print column name and index dataframe python 
Python :: django select_related and prefetch_related 
Python :: take union of two dataframes pandas 
Python :: python function __name__ 
Python :: indefinite loops python 
Python :: is enumerate python lazy 
Python :: spreadsheet worksheet counter 
Python :: tkinter hide legend 
Python :: python all available paths 
Python :: python pprint on file 
Python :: load py file converted from .ui file 
Python :: reverse sublist of linklist 
Python :: if statement collection python 
Python :: Using the token to make requests 
Python :: comparing dict key with integer 
Python :: pubmed database python 
Python :: ytdl python check video length 
Python :: #finding the similarity among two sets and 1 if statement 
Python :: python code to encrypt and decrypt a stringn with password 
Python :: éliminer le background image python 
Python :: pool.map multiple arguments 
Python :: django admin make column link 
Python :: scipy random seed 
Python :: Summarize text using LED huggingface 
Python :: flask get summernote text 
Python :: ValueError: unknown is not supported in sklearn.RFECV 
Python :: Jhoom.In 
Python :: remove repetitive characters from the specified column of a given DataFrame 
Python :: phow to install python modules in no internet in sercer 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =