fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var text = "Aaaa 50.05 bbbb 82.52 cccc 6.8888";
  12. var pattern = @"\d+\.\d+";
  13. var result = Regex.Replace(text, pattern, x => $"{Math.Round(Double.Parse(x.Value))}");
  14. Console.WriteLine(result);
  15. }
  16. }
Success #stdin #stdout 0.08s 29892KB
stdin
Standard input is empty
stdout
Aaaa 50 bbbb 83 cccc 7