using System.Collections.Generic;
string value = "This is a test to get the longest word";
static IEnumerable<string> GetWords(string input)
string value = "This is a test to get the longest word";
var word = new StringBuilder();
foreach (var character in input)
if (char.IsLetter(character))
yield return word.ToString();
word = new StringBuilder();