fork download
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5.  
  6. public class Test
  7. {
  8.  
  9.  
  10. public static void Main()
  11. {
  12. string str = "ab48/2012";
  13. string[] tokens = str.Split('/');
  14. int num = int.Parse(new string(tokens.First().Where(Char.IsDigit).ToArray()));
  15. int year = int.Parse(tokens.Last());
  16. Console.WriteLine(num);
  17. Console.WriteLine(year);
  18. }
  19. }
Success #stdin #stdout 0.03s 33984KB
stdin
Standard input is empty
stdout
48
2012