I have an absolute folder path and files path like following:
C:\BaseDir
- base folder
C:\BaseDir\sub\123.txt
- path to file that is located in base folder (but maybe also with some subfolders)
Another example of file path: C:\BaseDir\file.docx
or C:\BaseDir\sub\sub1\file.exe
I need to convert pathes to files from absolute to relative based on the base folder. Results should look like following:
sub\123.txt
; file.docx
; sub\sub1\file.exe
Please note, that I don't want BaseDir
in path. Solution should also work with network folders(\\Server1\BaseDir\file.docx
or \\172.31.1.60\BaseDir\sub\123.txt
).
Are there any built in classes that do this?