I have a collection of strings:
/a/b/111.txt
/a/b/c/222.txt
a/b/333.txt
a/b/c/d/444.txt
I want to this collection to be ordered like this:
/a/b/111.txt
a/b/333.txt
/a/b/c/222.txt
a/b/c/d/444.txt
So all a/b are grouped together, and so on.
Can this be done using linq? Or some other way?
Path.GetDirectoryName(inputStringPathHere)?data.OrderBy(x => x.Split('/').Length)?