fork(16) download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string[] x = { "1", "12", "10", "50", "8", null };
  9. var test = (from max in x
  10. where !String.IsNullOrEmpty(max)
  11. select Convert.ToInt32(max)).Max();
  12.  
  13. Console.WriteLine("Max Value = " +test.ToString());
  14.  
  15. }
  16. }
Success #stdin #stdout 0.03s 34000KB
stdin
Standard input is empty
stdout
Max Value  = 50