NedyalkoKikov

ListDemo

Jun 1st, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace List_Demo
  8. {
  9. class Program
  10. {
  11. static void Main()
  12. {
  13. List<string> products = new List<string>();
  14. products.Add("cheese");
  15. products.Add("olive oil");
  16. products.Add("drink");
  17. products.Add("cucumber");
  18. products[0] = "mutsarela";
  19. products.Add("peppers");
  20. products.RemoveAt(2);
  21. products.Insert(0, "olives");
  22. Console.WriteLine(string.Join(", ",products));
  23.  
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment