コード例 #1
0
ファイル: ThrowingExceptions.cs プロジェクト: ake698/Works
        private static bool Get(string[] fields)
        {
            if (fields[0] != "get")
            {
                return(false);
            }

            if (fields.Length < 2)
            {
                return(false);
            }

            string name = fields[1] == null ? null : fields[1];

            var result = shoppingList.Get(name);

            Console.Out.WriteLine($"Item '{name}': {result}.");

            return(true);
        }