这个小问题怎么解决啊!急救
这个小问题怎么解决啊!急救for (int j = 0; j < Category.Rows.Count(); j++)
{
CategoryParent += Category.Rows[i]["CategoryParent"]+",";
}
{
return Database.ExecuteDataset("Select * from PG_News_View where CategoryID in (""+CategoryParent+"")").Tables[0];
}
CategoryParent循环到最后变成CategoryParent=1,2,3,4,5,
怎么才能让最后一个不出现,号出来啊! --------------------编程问答-------------------- CategoryParent=CategoryParent.substring(0,CategoryParent.length-1)
或者
CategoryParent=CategoryParent.trimEnd... --------------------编程问答-------------------- CategoryParent=CategoryParent.substring(0,CategoryParent.length-1)
--------------------编程问答-------------------- for (int j = 0; j < Category.Rows.Count(); j++)
{
CategoryParent += Category.Rows[i]["CategoryParent"]+",";
}
CategoryParent = CategoryParent.substring(0,CategoryParent.length-1);
{
return Database.ExecuteDataset("Select * from PG_News_View where CategoryID in (""+CategoryParent+"")").Tables[0];
}
--------------------编程问答-------------------- 加一句CategoryParent=CategoryParent.substring(0,CategoryParent.length-1) 就ok
补充:.NET技术 , C#