Exemplo n.º 1
0
        static void Search(string searchString)
        {
            Stopwatch   timePerParse = Stopwatch.StartNew();
            ICityFinder cityFinder   = new CityFinder();
            ICityResult cityResult   = cityFinder.Search(searchString);

            timePerParse.Stop();

            Console.WriteLine($"Next Cities: {cityResult.NextCities.Count}.");
            Console.WriteLine($"Next Letters: {cityResult.NextLetters.Count}.");
            Console.WriteLine($"Time (ms): {timePerParse.Elapsed.Milliseconds}.");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            CityFinder  cf   = new CityFinder();
            ICityResult cres = cf.Search("Bang");

            foreach (var item in cres.NextCities)
            {
                Console.WriteLine(item.ToString());
            }

            foreach (var item in cres.NextLetters)
            {
                Console.WriteLine(item.ToString());
            }

            Console.Read();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please input the start of the city name");

            string searchString = Console.ReadLine();

            ICityFinder finder = new CityFinder();

            var result = finder.Search(searchString);

            foreach (string l in result.NextLetters)
            {
                Console.WriteLine(l);
            }

            foreach (string city in result.NextCities)
            {
                Console.WriteLine(city);
            }
        }