日期:2014-05-17  浏览次数:21102 次

将一个字符串数组输出为|分割的形式(C#)
string[] Str1 = { "北", "京", "你", "好" };
            string str = "";
            for (int i = 0; i < Str1.Length - 1; i++)
            {
                str = str + Str1[i] + "|";
            }
            if (Str1.Length > 0)
            {
                str = str + Str1[Str1.Length - 1];
            }
            Console.WriteLine(str);