Windows and Unix line breaks Split

import re

//The second argument is
//For windows system\\n,
//For Unix\n
//Supports multiple delimiters with regular expressions
re.split(r"\\n|\n", "aaa\\nbbb") 

Recommended Posts

Windows and Unix line breaks Split
Python and Ruby split
Install Python and Flask (Windows 10)
python> print> N line breaks> print ('\ n'* 3)> 4 line breaks> print ('\ n'* 3),> 3 line breaks