Strip trailing spaces : Rstrip : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Rstrip »

 

Strip trailing spaces


import string
badSentence = "ttThis sentence has problems.   "


#Strip trailing spaces
print "Length = " + str(len(badSentence))
print "Without trailing spaces = " + str(len(badSentence.rstrip(' ')))



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Rstrip