Mega Code Archive

 
Categories / Python Tutorial / String
 

Strip tabs

import string badSentence = "\t\tThis sentence has problems.   " print "\nBad:\n" + badSentence print "\nFixed:\n" + badSentence.lstrip('\t')