fork(2) download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. IEnumerable<string> s = new List<string>() { "1", "2", "3" };
  10. var i = s.Select(url =>
  11. {
  12. Console.WriteLine(url);
  13. url = string.Format("--{0}--",url);
  14. return url;
  15. }
  16. ).ToList();
  17.  
  18. Console.WriteLine("done with selector");
  19. foreach (string f in i)
  20. {
  21. Console.WriteLine("f is {0}", f);
  22. }
  23. }
  24. }
Success #stdin #stdout 0.01s 131648KB
stdin
Standard input is empty
stdout
1
2
3
done with selector
f is --1--
f is --2--
f is --3--