Guest User

Untitled

a guest
Dec 13th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. List<string> list = new List<string> { "..." };
  2. foreach (var item in list)
  3. {
  4. Console.WriteLine(item);
  5. }
  6.  
  7. List<string> list = new List<string> { "..." };
  8. using (List<string>.Enumerator enumerator = list.GetEnumerator())
  9. {
  10. while (enumerator.MoveNext())
  11. {
  12. string item = enumerator.Current;
  13. Console.WriteLine(item);
  14. }
  15. }
  16.  
  17. IEnumerable<string> list = new List<string> { "..." };
  18. foreach (var item in list)
  19. {
  20. Console.WriteLine(item);
  21. }
  22.  
  23. using (IEnumerator<string> enumerator = list.GetEnumerator())
Add Comment
Please, Sign In to add comment