condense whitespace to single space?

François Pinard pinard at iro.umontreal.ca
Fri May 12 19:21:04 EDT 2000


Moshe Zadka <moshez at math.huji.ac.il> writes:

> > How do I condense the sections of spaces in this string:
> > "abc              def         ghi"
> > into single spaces?

> string.join(string.split(s), ' ')

string.join(string.split(s))   :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list