condense whitespace to single space?

Moshe Zadka moshez at math.huji.ac.il
Thu Apr 27 02:01:42 EDT 2000


On Wed, 26 Apr 2000, k wrote:

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

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

--
Moshe Zadka <mzadka at geocities.com>. 
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list