String filePath = @"c:\file\neme\file.txt";
=> filePath.Split('\\')[filePath.Split('\\').Length-1] ----> Will give file name with extension
=> (filePath.Split('\\')[filePath.Split('\\').Length-1]).Split('.')[0] --> Will give file name without extension
=> filePath.Split('\\')[0] --> Will give drive letter
No comments:
Post a Comment