I'm trying to get a string array with single words from a textfile. However the array is filled with some empty lines. Any Idea how I can make a string array without those empty lines?
WebClient client = new WebClient();
Stream stream = client.OpenRead("https://gist.githubusercontent.com/Quackmatic/f8deb2b64dd07ea0985d/raw/macbeth.txt");
StreamReader reader = new StreamReader(stream);
string[] content = reader.ReadToEnd().Split('?', '!', ' ', '\n', '[', ']', '.');
for (int i = 0; i < 5; i++)
{
Console.WriteLine(content[i]);
}
Console.ReadLine();