Suppose I have the directory path:
D:\aa\bb
and inside of it can be more file or folders with sub folders
for example
D:\aa\bb\test.txt
D:\aa\bb\cc\test.txt
D:\aa\bb\cc\dd\test.txt
is there a clean way to extract the right part of the path?
I need something like:
string ExtractRightPart(string fullPath)
{
return ...
}
Examples:
For input
D:\aa\bb\cc\dd\test.txt
the function should return
cc\dd\test.txt
And for input
D:\aa\bb\test.txt
the function should return
test.txt