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 = "MCHH-1-00001";
  13. string identifier = "MCHH-1-";
  14. int num = int.Parse(str.Substring(identifier.Length));
  15. str = identifier + (++num).ToString("D5");
  16. Console.WriteLine(str);
  17. }
  18. }
Success #stdin #stdout 0.03s 33896KB
stdin
Standard input is empty
stdout
MCHH-1-00002