17 Nov
2003
17 Nov
'03
11:24 p.m.
On Mon, 2003-11-17 at 15:17, Dylan Reinhardt wrote:
The splitlines() method (like other split methods) returns what was found before the split character and (if applicable) what is found after each subsequent split character.
Actually, this is not entirely correct, now that I read it. string.splitlines() is a slightly special case in that it doesn't include what is after the last newline character. If you used string.split('\n') you'd get an element for what came after the last newline character. Ex:
foo = 'a\nb\n' foo.splitlines() ['a', 'b'] foo.split('\n') ['a', 'b', '']
FWIW, Dylan