What was I thinking? split() will only work if you have no other
whitespace characters in the string. A regex like "[\n\r]+" is indeed
much more appropriate and robust.
Cheers
-Basilisk96
--
http://mail.python.org/mailman/listinfo/python-list
why not use split:
>>>s = "
>>>a\n\n\n\n\n\n\n\n\nsss\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvsa\n\n\n\nasf...
>>>\n\nafs"
>>>s.split()
['a', 'sss', '', 'vsa', 'asf...', 'afs']
--
http://mail.python.org/mailman/listinfo/python-list
On 1 May 2007 14:30:12 -0700, mobil <[EMAIL PROTECTED]> wrote:
> Hi guys i m trying out newline characters and to clean them up
> a\n\n\n\n\n\n\n\n\nsss\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvsa\n\n\n\nasf
> \n\nafs
>
> hello guys
>
> im trying to replace
> \n\n\n\n\n\n\n\n\n with \n
>
> thanks for help