Given a string filepath how to obtain the substring representing the directory name that contains the file in the given string path. for example, \\subfolder\\abc.txt or
\\folder\\subfolder\\abc.txt how can i easily obtain subfolder string between the two backslashes \\ ?
Given a string filepath how to obtain the substring representing the directory name that
Share
You can use FileInfo and DirectoryInfo classes, like this –