首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

想删除子串,remove运行无效,请大家帮小弟我看看哪里出了有关问题

2012-02-03 
想删除子串,remove运行无效,请大家帮我看看哪里出了问题。代码如下:for(inti0ithis.SelectedPar_ListBox

想删除子串,remove运行无效,请大家帮我看看哪里出了问题。
代码如下:
for(int   i   =   0   ;i   <   this.SelectedPar_ListBox.Items.Count;i   ++)
{
if(this.SelectedPar_ListBox.Items[i].Selected)
{


if(i!=0)
{
removedSql= ", "+this.SelectedPar_ListBox.Items[i].Value   +   "   AS   "   +this.SelectedPar_ListBox.Items[i].Text;
startIndex=sql.IndexOf(removedSql);
length=removedSql.Length;

}
else
{
removedSql=this.SelectedPar_ListBox.Items[i].Value   +   "   AS   "   +this.SelectedPar_ListBox.Items[i].Text;
startIndex=sql.IndexOf(removedSql);
length=removedSql.Length;

}
sql.Remove(startIndex,length);
this.SelectedPar_ListBox.Items.Remove(this.SelectedPar_ListBox.Items[i]);

}

}//

[解决办法]
那就进来抢分了。

热点排行