fork(2) 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 input = " a.1.2.3 #4567 ";
  13. int poundIndex = input.IndexOf("#");
  14. if(poundIndex >= 0)
  15. {
  16. string relevantPart = input.Substring(0, poundIndex).Trim();
  17. IEnumerable<Char> numPart = relevantPart
  18. .SkipWhile(c => !Char.IsDigit(c));
  19. string result = new string(numPart.ToArray());
  20. Console.Write(result);
  21. }
  22. }
  23. }
Success #stdin #stdout 0.05s 33944KB
stdin
Standard input is empty
stdout
1.2.3