日期:2014-05-18 浏览次数:21014 次
string[] strs = new string[2]; strs[0] = "abc"; strs[1] = "def"; ArrayList al = new ArrayList(); foreach (var item in strs) { char[] ArrayItem= item.ToCharArray(); al.AddRange(ArrayItem); } foreach (var item in al) { Console.WriteLine(item); }
------解决方案--------------------
string[] str = new string[3]; str[0] = "abcdefg"; str[1] = "hijklmn"; str[2] = "opqrstu"; for (int i = 0; i < str.Length - 1; i++) { string s = str[i]; for (int k = 0; k < s.Length - 1; k++) { string[] SaveStr = new string[s.Length-1]; SaveStr[k] = Convert.ToString(s[k]); } }