using System; using System.IO; public class Example { public static void Main() { string filepath= @"C:\1234\5678\abc.csv"; // 直接將副檔名給null就會清空 string onlyFileNamePath = Path.ChangeExtension(filepath, null); Console.WriteLine(filePathWithoutExt); } }
The post 移除檔案的副檔名 appeared first on 可丁丹尼 @ 一路往前走2.0.