I have looked online for many solutions to my problem. I want to ask the user to input a sentence and write the sentence out one word per line using the split method. I have ask
You are currently splitting by a comma ,
only when you need to split by punctuations that may exist in a sentence like space " "
comma ","
and peroid "."
//..other code
string[] split = sentenceTwo.Split(new char[]{' ', '.', ','}, System.StringSplitOptions.RemoveEmptyEntries);
foreach (string item in split)
{
Console.WriteLine(item);
}
//..other code