6
Bu dize bölmek gerekir
ekleyen {"hello1\r\nhello2" , "hello3", "hello4"}
Çift veya daha fazla boş satır nasıl bölünür? <code>"hello1rnhello2rnrnhello3rnrnrnhello4"</code> için: Regex.Stplit istenmeyen dizeleri
kodum:
string text = "hello1\r\nhello2\r\n\r\nhello3\r\n\r\n\r\nhello4";
string[] wordsarray = Regex.Split(text, @"(\r\n){2,}");
sonucudur: Yanlış yapıyorum {"hello1\r\nhello2" ,"\r\n" , "hello3" ,"\r\n" ,"hello4"}
?
+1. [Regex.Split] (http://msdn.microsoft.com/en-us/library/8yttk7sy.aspx) 'in açıklama sekresinin davranışları hakkında ayrıntılı bilgi vardır. –