<br><br><div class="gmail_quote">On Tue, Sep 1, 2009 at 7:46 AM, Sander Sweers <span dir="ltr"><<a href="mailto:sander.sweers@gmail.com">sander.sweers@gmail.com</a>></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 <<a href="mailto:rabidpoobear@gmail.com">rabidpoobear@gmail.com</a>>:<br>
<div class="im">>>>> txt = "Hi how are you?"<br>
>>>> " ".join(txt.strip().split())<br>
> 'Hi how are you?'<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't remember if split() would leave the trailing newline on the last item.</div></div>