Whitespace test after string.split

Fredrik Lundh fredrik at pythonware.com
Sat Nov 26 10:42:47 EST 2005


Peter Otten wrote:

>>>> [t.strip() for t in s.split(",") if t and not t.isspace()]
> ['alpha', 'gamma', 'delta']

footnote: this solution is faster than my filter version.

</F> 






More information about the Python-list mailing list