def split_on_newlines(s):
 res = []
 for x in s.split('\r\n'):
  for y in x.split('\r'):
   res.extend(y.split('\n'))
 return res

def split_on_newlines ( s ) : res = [ ] for x in s . split ( '\r\n' ) : for y in x . split ( '\r' ) : res . extend ( y . split ( '\n' ) ) return res
splits s on all of the three newline sequences: " " .