fork(2) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string[] test = new string[] {"1", "2", "3", "4", "5"};
  8.  
  9. Console.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss.ffff"));
  10.  
  11. int[] arr = Array.ConvertAll<string, int>(test, int.Parse);
  12.  
  13. Console.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss.ffff"));
  14.  
  15. Console.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss.ffff"));
  16.  
  17. arr = new int[test.Length];
  18. for(int i=0; i< test.Length;i++)
  19. {
  20. arr[i] = int.Parse(test[i]);
  21. }
  22.  
  23. Console.WriteLine(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss.ffff"));
  24.  
  25. foreach (int a in arr)
  26. {
  27. Console.WriteLine("Integer: " + a + " Type: " + a.GetType().ToString());
  28. }
  29. }
  30. }
Success #stdin #stdout 0.08s 24080KB
stdin
Standard input is empty
stdout
19-08-2015 11:17:24.3502
19-08-2015 11:17:24.5019
19-08-2015 11:17:24.5020
19-08-2015 11:17:24.5020
Integer: 1 Type: System.Int32
Integer: 2 Type: System.Int32
Integer: 3 Type: System.Int32
Integer: 4 Type: System.Int32
Integer: 5 Type: System.Int32