I have got a List of strings like:
- String1
- String1.String2
- String1.String2.String3
- Other1
- Other1.Other2
- Test1
- Stuff1.Stuff1
- Text1.Text2.Text3
- Folder1.Folder2.FolderA
- Folder1.Folder2.FolderB
- Folder1.Folder2.FolderB.FolderC
Now I would like to group this into:
- String1.String2.String3
- Other1.Other2
- Test1
- Stuff1.Stuff1
- Text1.Text2.Text3
- Folder1.Folder2.FolderA
- Folder1.Folder2.FolderB.FolderC
If "String1" is in the next item "String1.String2" I will ignore the first one and if the second item is in the third I will only take the third "String1.String2.String3" and so on (n items). The string is structured like a node/path and could be split by a dot.
As you can see for the Folder example Folder2 has got two different Subfolder items so I would need both strings.
Do you know how to handle this with Linq? I would prefer VB.Net but C# is also ok.
Regards Athu