6
내가이 문자열을 분할해야
을 추가 {"hello1\r\nhello2" , "hello3", "hello4"}
두 줄 이상의 빈 줄로 나누는 방법은 무엇입니까? <code>"hello1rnhello2rnrnhello3rnrnrnhello4"</code> 에 : Regex.Stplit 원하지 않는 문자열
내 코드 :
string text = "hello1\r\nhello2\r\n\r\nhello3\r\n\r\n\r\nhello4";
string[] wordsarray = Regex.Split(text, @"(\r\n){2,}");
결과는 다음과 같습니다 내가 잘못 뭐하는 거지 {"hello1\r\nhello2" ,"\r\n" , "hello3" ,"\r\n" ,"hello4"}
?
+1. 설명 [regex.Split] (http://msdn.microsoft.com/en-us/library/8yttk7sy.aspx)의 secion에는 동작에 대한 자세한 내용이 있습니다. –