Extract filename from path

后端 未结 8 813
梦谈多话
梦谈多话 2021-01-04 08:21

I need to extract the filename from a path (a string):

e.g., \"C:\\folder\\folder\\folder\\file.txt\" = \"file\" (or even \"file.txt\" to get me sta

8条回答
  •  情深已故
    2021-01-04 08:27

    I used kaveman's suggestion successfully as well to get the Full File name but sometimes when i have lots of Dots in my Full File Name, I used the following to get rid of the .txt bit:

    FileName = Left(FullFileName, (InStrRev(FullFileName, ".") - 1))
    

提交回复
热议问题