I need to break this line: "hello1\r\nhello2\r\n\r\nhello3\r\n\r\n\r\nhello4" to: {"hello1\r\nhello2" , "hello3", "hello4"}
my code is:
string text = "hello1\r\nhello2\r\n\r\nhello3\r\n\r\n\r\nhello4"; string[] wordsarray = Regex.Split(text, @"(\r\n){2,}");
Result: {"hello1\r\nhello2" ,"\r\n" , "hello3" ,"\r\n" ,"hello4"}
What am I doing wrong?
source share