读书人

想删除子串remove运行无效请大家帮

发布时间: 2012-02-03 22:02:47 作者: rapoo

想删除子串,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]);

}

}//

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

读书人网 >asp.net

热点推荐