you need namespace using System.Text.RegularExpressions;
on form load event
{
char[] delimiterChars = { '.', ',', '.', ':','?', '\t' };
string text = "Hello world. How are you? I am fine. This is a difficult sentence because I use I.D.Newlines should also be accepted. Numbers should not cause sentence breaks.";
string[] words = text.Split(delimiterChars);
foreach (String match in words)
{
comboBox1.Items.Add(match);
}
}
on form load event
{
char[] delimiterChars = { '.', ',', '.', ':','?', '\t' };
string text = "Hello world. How are you? I am fine. This is a difficult sentence because I use I.D.Newlines should also be accepted. Numbers should not cause sentence breaks.";
string[] words = text.Split(delimiterChars);
foreach (String match in words)
{
comboBox1.Items.Add(match);
}
}
Output:
Hello world
How are you
I am fine
and so on......
No comments:
Post a Comment