Exemple #1
0
        static void Main(string[] args)
        {
            string    filePath = @"G:\G_Work\Pluralsight\Courses\Beginning Effective Collections\Code\Pop by Largest Final.csv";
            CsvReader reader   = new CsvReader(filePath);

            Country[] countries = reader.ReadFirstNCountries(10);

            foreach (Country country in countries)
            {
                Console.WriteLine($"{PopulationFormatter.FormatPopulation(country.Population).PadLeft(15)}: {country.Name}");
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            string    filePath = @"c:\temp\Pop by Largest Final.csv";
            CsvReader reader   = new CsvReader(filePath);

            Country[] countries = reader.ReadFirstNCountries(10);

            foreach (Country country in countries)
            {
                Console.WriteLine($"{PopulationFormatter.FormatPopulation(country.Population).PadLeft(15)}: {country.Name}");
            }
        }
        static void Main(string[] args)
        {
            string    filePath = @"C:\Users\tarep\Documents\PluralSight\BeginningCSharpCollections_Pluralsight\Pop by Largest Final.csv";
            CsvReader reader   = new CsvReader(filePath);

            Country[] countries = reader.ReadFirstNCountries(10);

            foreach (Country country in countries)
            {
                Console.WriteLine($"{PopulationFormatter.FormatPopulation(country.Population).PadLeft(15)}: {country.Name}");
            }

            Console.ReadLine();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            string    filePath = @"C:\cs\pluralsight\csharp-collections-beginning\Pop by Largest Final.csv";
            CsvReader reader   = new CsvReader(filePath);

            List <Country> countries = reader.ReadAllCountries();

            foreach (Country country in countries)
            {
                Console.WriteLine($"{PopulationFormatter.FormatPopulation(country.Population).PadLeft(15)}: {country.Name}");
            }
            Console.WriteLine($"Total Countries count is: {countries.Count}");
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            string    filePath = @"E:\Capgemini\Azure Training\C# Collections\TopTenPops\Pop by Largest Final.csv";
            CsvReader reader   = new CsvReader(filePath);

            Country[] countries = reader.ReadFirstNCountries(10);

            foreach (Country country in countries)
            {
                Console.WriteLine($"{PopulationFormatter.FormatPopulation(country.Population).PadLeft(15)}: {country.Name}");
            }

            Console.ReadLine();
        }