0
,所以我有一些字符串列表中的分组由分裂的结果列表
Folder1\File.png
Folder1\File2.png
File3.png
File4.png
,我想在一个split('\\')[0];
例如组这些
foreach (var group in files.GroupBy(x => //mysplit))
{
if (group.Count() > 1)
{
// this is a folder and its files are: group
}
else
{
//group is an individual file
}
}
,但我不知道如何通过这个拆分对文件进行分组?
如果这些都有效的路径,您可能需要使用.NET内置检查。 http://stackoverflow.com/questions/439447/net-how-to-check-if-path-is-a-file-and-not-a-directory – Neolisk 2015-03-19 11:22:33
他们Azure路径,我建立我自己的Azure浏览器 – user1 2015-03-19 11:24:41