Split the sentence into tokens. This can be useful, for example, for a search engine.
There are several rules:
Multiple words in quotation marks must be included in the same token
This "huge test" is pointless => this,huge test,is,pointless
Hyphenated words are also included in the same token. Words written with several hyphens (dashes), or having a hyphen at the beginning or end, are placed in separate tokens.
Suzie Smith-Hopper test--hyphens => Suzie,Smith-Hopper,test,hyphens.
My try:
label.Text = "";
string s = "I like-it 'very very'";
string[] arr = Regex.Split(s, @"(\s)|(')");
foreach (var item in arr)
{
label.Text += item + ", ";
}
but it doesn't work for me