get directory from full path

前端 未结 10 1390
慢半拍i
慢半拍i 2021-01-01 11:54

If i have:

C:\\temp\\foo\\bar\\

(NOTE: bar is a directory)

how can i parse out:

bar

10条回答
  •  甜味超标
    2021-01-01 12:34

    In Unix this is known as the basename, a quick google came up with this link for a C# version. I'm sure there are others ...

提交回复
热议问题