Skip to content

Instantly share code, notes, and snippets.

@shassaan
Created November 3, 2020 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shassaan/1f54bb9fd76dc6928f2c13324a58ac54 to your computer and use it in GitHub Desktop.
Save shassaan/1f54bb9fd76dc6928f2c13324a58ac54 to your computer and use it in GitHub Desktop.
RetrieveDataFromList
//Access individual item using indexer
List<int> numbers = new List<int>()
{ 1, 2, 5, 7, 8, 10 };
Console.WriteLine(numbers[0]); // prints 1
Console.WriteLine(numbers[1]); // prints 2
Console.WriteLine(numbers[2]); // prints 5
Console.WriteLine(numbers[3]); // prints 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment