HI all.
I have several folders that have folders inside of them. I'm trying to get just the top level folder name, such as,
I have:
D:\Music\Rock\Scorpions
D:\Music\Rock\Scorpions\World Wide Live
I just want to return "Music" for both lines. I know how to get a list of all the directories for a certain drive, but when I scan directories for all files, I just want to return the top level directory name.
Thanks for your help!
Zcast
Loading
VulpesPosted Jan 22, 2012, 10:21 AM
This splits the path using the '\' as the separator and then selects the second string in the resulting array, which has an index of 1.