Suppose you have output like this:
Word1 Word2 Word3 Word4
Where the number of spaces between words is arbitrary. I want to break it into an array of words.
I used the following code:
string[] tokens =
new List<String>(input.Split(' '))
.FindAll
(
delegate(string token)
{
return token != String.Empty;
}
).ToArray();
Not exactly efficient, but does the job nicely.
How would you do it?