splitlines() - Splits the string at line breaks and returns a list

Splits a line by carriage return and/or line feed line breaks.  The return is an array of separate lines.

Example

Python
print('Hello\rWorld'.splitlines())    # carriage return
print('Hello\r\nWorld'.splitlines())  # carriage return and new line
print('Hello\nWorld'.splitlines())    # new line

Output

['Hello', 'World']
['Hello', 'World']
['Hello', 'World']