Strip leading and trailing characters : Strip : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Strip »

 

Strip leading and trailing characters


import string

badParagraph = "ttThis paragraph nhas even more nproblems.!?   "


print "nBad:n" + badParagraph
print "nFixed:n" + badParagraph.strip((' ?!t'))



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo String
» Strip