I have a file consisting of two columns that will be stored as a Dictionary where the first column will be the key, and the second column will be the value. The second column is delimited by whitespace, which may be any amount of spaces or tabs.
How do I store this in my Dictionary with the Split() function?
recipesFile = new StreamReader(recipesRes.Stream);
char[] splitChars = {'\t', ' '};
while (recipesFile.Peek() > 0)
{
string recipesLine = "";
recipesLine = recipesFile.ReadLine();
string[] recipesInLine = recipesLine.Split(splitChars);
recipes.Add(recipesInLine[0], recipesInLine[1]);
}
Thanks