实现目标,原来字符串是个目录,我需要一级一级的取,类似目录的功能,
- 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); }
时间: 2025-01-06 19:09:25