调用代码:
IList<int> csj1=Sql_List(); // 把处理返回的list数组赋值给csj1
string csj_str="";
foreach (int i in csj1)
{
csj_str+= i.ToString() + ",";
}
g("终于实现了:" + strTest + "共" + csj1.Count + "条");
处理代码:
public static IList<int> Sql_List()
{
List<int> csj = new List<int>();
csj.Add(5);
csj.Add(2);
csj.Add(0);
return csj;
}
本文介绍了一个简单的C#程序实例,展示了如何创建并填充整数列表,然后遍历该列表将每个元素转换为字符串形式,并以逗号连接起来。此过程有助于理解基本的数据结构操作及字符串拼接技巧。
129

被折叠的 条评论
为什么被折叠?



