I have a directory that looks something like this:
C:\Users\me\Projects\
In my application, I add the name of this project to this path:
C:\Users\me\Projects\myProject
After that, I want to pass this to the method. Inside this method, I would also like to use the name of the project. What is the best way to parse a path string to get the last folder name?
I know that the workaround should be to pass the path and name of the project to the function, but I was hoping to limit it to one parameter.
c # parsing filepath
Adammc331
source share