我有一个字符串 path = c:\inetpub\wwwrroot\images\pdf\admission.pdf
我正在使用这个
path = path.LastIndexOf("\\").ToString();
path = path.Substring(path.LastIndexOf("/") + 1);
i want to get:
c:\inetpub\wwwrroot\images\pdf
c:\inetpub\wwwrroot\images\pdf\admission.pdf
现在我想从这个 string path
获取 admission.pdf 文件,我该如何做?
IO.Path
函数之一。手动使用String.Substring
很容易出问题。 - Cody Gray