The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
string inputValue = "this is my first sentence.";
string[] inputWords =
inputValue.Split(new char[] { ' ', ',', ';', '.', '-', '/', '|', '\\',
'%', '#', '@', '!', '~', '$', '^', '(',
')', '+', '[', ']', '{', '}', '"', ':',
'<', '>', '?', '\r', '\n', '*' }, StringSplitOptions.RemoveEmptyEntries);
foreach (string inputWord in inputWords)
{
Console.WriteLine(inputWord);
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
string[] words = sample.Split(' ');
foreach (string word in words)
{
Console.WriteLine(word);
}
Cheers
Kurt