Alright so I've looked hard but I couldn't seem to find answer to my problem. There must be a problem in my code and it would be really helpful if someone could look at it for me.
Dictionary<string, string> keylist = new Dictionary<string, string>();
if (intext.Contains("addkey") && intext.Contains("def"))
{
string[] keywords = intext.Split(' ');
string key1 = keywords[1];
string def2 = keywords[3];
string fkey = key1.Replace("_", " ");
string fdef = def2.Replace("_", " ");
keylist.Add(fkey, fdef);
say("Phrase '" + fkey + "' added with response '" + fdef + "'");
say("Your Dictionary contains " + keylist.Count.ToString() + " word(s).");
//////////////////////////////
}
All I want it to do is take the input in the form of "addkey key_here def definition_here" and add it to the dictionary. I added the counting part for debugging purposes and it always says I only have 1 word in the dictionary no matter how many I have added. You can probably tell I'm new so please be gentle. Thanks