首页 > 代码库 > c#/.Net 集合数组一层一层的取值

c#/.Net 集合数组一层一层的取值

技术分享

实现目标,原来字符串是个目录,我需要一级一级的取,类似目录的功能,

  1. Console.WriteLine("原字符串 bbb/ccc/ddd/eee 分隔符 /");
Console.WriteLine("原字符串 bbb/ccc/ddd/eee 分隔符 /");
            string[] mulu = "bbb/ccc/ddd/eee".Split(/);
            for (int i = 0; i < mulu.Length; i++)
            {
                string temp = string.Join("/", mulu.Take(i + 1));
                Console.WriteLine(temp);
            }

 

c#/.Net 集合数组一层一层的取值