fork download
  1. using static System.Console;
  2. using System.Text;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var hs = "/4587 / 5458/";
  7. var texto = new StringBuilder(hs.Length);
  8. var digito = true;
  9. foreach (var chr in hs) {
  10. if (char.IsDigit(chr)) {
  11. if (!digito) texto.Append(';');
  12. texto.Append(chr);
  13. digito = true;
  14. } else digito = false;
  15. }
  16. WriteLine(texto.ToString());
  17. }
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/320134/101
Success #stdin #stdout 0.02s 15960KB
stdin
Standard input is empty
stdout
;4587;5458