fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.Net;
  6. using System.IO;
  7.  
  8.  
  9.  
  10. public class Test
  11. {
  12. public static void Main()
  13. {
  14. string path = "Example01.1234312232.txt";
  15. string fileNameOnly = Path.GetFileNameWithoutExtension(path);
  16. string newFileName = string.Format("{0}.{1}",
  17. fileNameOnly.Split('.')[0],
  18. Path.GetExtension(path));
  19. Console.WriteLine(newFileName);
  20. }
  21. }
  22.  
  23.  
  24.  
Success #stdin #stdout 0.02s 33832KB
stdin
Standard input is empty
stdout
Example01..txt