fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. object[] test = new object[5];
  9. test[0] = "Hello,Ken";
  10. test[1] = 3.1415;
  11. test[2] = "Hello,Taro";
  12. test[3] = "Hi,Yoko";
  13. test[4] = 27182;
  14.  
  15. var hellos =
  16. test
  17. .Where(o => o.Contains("Hello"))
  18. .Select(o => o.ToString())
  19. ;
  20. // .Where(o => o != null)
  21. // .Select(o => o.ToString())
  22. // .Where(o => o.Contains("Hello"))
  23. // ;
  24.  
  25. foreach(var hello in hellos) {
  26. Console.WriteLine(hello);
  27. }
  28. }
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(17,20): error CS1929: Type `object' does not contain a member `Contains' and the best extension method overload `System.Linq.ParallelEnumerable.Contains<string>(this System.Linq.ParallelQuery<string>, string)' requires an instance of type `System.Linq.ParallelQuery<string>'
/usr/lib/mono/4.5/System.Core.dll (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty