Please can someone help me with the regex.split expression I need:
to be able to split the string of text in textBox1 into paragraphs
where a blank line between lines of text is the delimiter.
Please can someone help me with the regex.split expression I need:
to be able to split the string of text in textBox1 into paragraphs
where a blank line between lines of text is the delimiter.
split textBox1.text into paragraphs
GTH
If i understand what your saying correctly thiers this::
using
(StreamReader sr = new StreamReader(ofd.FileName)) this is using a OpenFileDialog "ofd"this
.listView1.Items.Add(new ListViewItem(sr.ReadLine().Split(':'))); // Adding a Semi Colon example johndoe : 0123456than theirs::
StreamWriter writer = File.CreateText("reminders.txt");
writer.WriteLine("Dont forget its Mothers day");
writer.WriteLine("Dont forget its Fathers day");
write.WriteLine(" Happy Fathers Day");
for (int i = 0; i < 10; i ++);
writer.Write(i + " ");
// insert a new line
writer.WriteLine(writer.NewLine);
//Closing automatically flushes
writer.Close();
Hope this gives you some idea's with what you needed...
ACCOUNTINGONLINE.US
thanks but maybe I was not clear. The user enters some text into textBox1 in the form of paragraphs with 1 blank line between paragraphs.
I would like to split the paragraphs and need help with the regex.split expression. I tried
foreach (string strItem in Regex.Split(textBox1.Text, ("" + ("\n\n")))){
MessageBox.Show (strItem);}
but this does not seem to work.
Rod Yager
Figured it out if anyone is interested
Regex.Split(textBox1.Text, "\r\n\r\n")