<br><br><div class="gmail_quote">On Tue, Sep 1, 2009 at 7:46 AM, Sander Sweers <span dir="ltr">&lt;<a href="mailto:sander.sweers@gmail.com">sander.sweers@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2009/9/1 Luke Paireepinart &lt;<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>&gt;:<br>
<div class="im">&gt;&gt;&gt;&gt; txt = &quot;Hi          how are you?&quot;<br>
&gt;&gt;&gt;&gt; &quot; &quot;.join(txt.strip().split())<br>
&gt; &#39;Hi how are you?&#39;<br>
<br>
</div>txt.strip() only remove leading and trailing white space so does<br>
nothing in your example.</blockquote><div>It removes newlines as well.</div><div>I couldn&#39;t remember if split() would leave the trailing newline on the last item.</div></div>