6 lines
194 B
Python
6 lines
194 B
Python
>>> s = "This is a line.\nAnd this is another line.\n"
|
|
>>> s.split("\n")
|
|
['This is a line.', 'And this is another line.', '']
|
|
>>> s.splitlines()
|
|
['This is a line.', 'And this is another line.']
|