static IEnumerable<string> TokenizeText (string text)
{
int index = 0;
while (index < text.Length) {
int startIndex = index;
while (index < text.Length && !IsWhiteSpace (text[index]))
index++;
yield return text.Substring (startIndex, index - startIndex);
if (index == text.Length)
break;
startIndex = index;
while (index < text.Length && IsWhiteSpace (text[index]))
index++;
yield return text.Substring (startIndex, index - startIndex);
}
yield break;
}