fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. //Console.Write("100".TrimEnd('0'));
  9. string str = "123,90\n123,00\n123,0\n123,0090\n00,34\nABC";
  10.  
  11. Console.Write(Regex.Replace(str, @"(,\d*?)0+\b", "$1"));
  12. }
  13. }
Success #stdin #stdout 0.11s 24736KB
stdin
Standard input is empty
stdout
123,9
123,
123,
123,009
00,34
ABC