class Program
{
static void Main()
{
string s = "there is a cat";
//
// Split string on spaces.
// ... This will separate all the words.
//
string[] words = s.Split(' ');
foreach (string word in words)
{
Console.WriteLine(word);
}
}
}
//OUTPUT
there
is
a
cat
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/SYJ20_L4CKY/14303