Help me to get the folder name from a file path

@StevenIsRobotOnline

As this is a path…it would be good to use path related commands

Path.GetFileName(Path.GetDirectoryName("YourPath"))

or

new DirectoryInfo(System.IO.Path.GetDirectoryName("YourPath")).Name

cheers

2 Likes