set
just the same way, such, that it also contains the line-breaks?str.splitlines()
method does exactly what you want if you pass True
as the optional keepends
parameter. It keeps the newlines on the end of each line, and doesn't add one to the last line if there was no newline at the end of the string.U
for universal line endings:str.replace('; ', ', ')
and then a str.split(', ')
RegexObject.split
.