[Tutor] how to strip whitespaces from a string.

kumar s ps_python at yahoo.com
Fri Oct 8 19:07:57 CEST 2004


Dear group, 
 I have been practising python for some time now and
string method 'strip' always remains an alien to me.
whenever i try to use it, i never got what i want and
now it still remainins an enigma. 

s = " I am learning python"

how can i remove white spaces from 's'. 

f = s.strip('\w') - wrong


can any one help me understanding strip method. 

Thank you. 

Kumar

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Tutor mailing list