Exemplo n.º 1
0
        private static void AddToDictionary(string command, WordsDictionary redisDictionary)
        {
            int wordStartIndex = command.IndexOf(' ') + 1;
            int wordEndIndex   = command.IndexOf('-');

            string word        = command.Substring(wordStartIndex, wordEndIndex - wordStartIndex).Trim();
            string translation = command.Substring(wordEndIndex + 1).Trim();

            redisDictionary.Add(word, translation);
            Console.WriteLine("Word is added successfully.");
        }