为了账号安全,请及时绑定邮箱和手机立即绑定

语法sb = sb.Substring(0, sb.Length - 1);求问是什么意思?

语法sb = sb.Substring(0, sb.Length - 1);求问是什么意思?

MMTTMM 2021-10-10 13:10:47
protected void btnModify_Click(object sender, EventArgs e) { string sb =String.Empty; for (int i = 0; i < this.gvBooks.Rows.Count; i++) { CheckBox cb = (gvBooks.Rows[i].FindControl("chbSelect")) as CheckBox; if (cb.Checked == true) { sb += (gvBooks.Rows[i].FindControl("lblId") as Label).Text+","; } } string catagory = this.ddlCatagory.SelectedItem.Value; ChangeCatagory(sb, catagory); } private void ChangeCatagory(String sb, string catagoryid) { if (sb.Length > 0) { sb = sb.Substring(0, sb.Length - 1); } BookManager.ModifyCatagory(sb, catagoryid); Response.Redirect("ListBooksByCategory.aspx"); } 这段代码中 sb = sb.Substring(0, sb.Length - 1);是什么意思,特别是sb.Length - 1在这里的意思,越具体越好,谢咯
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 232 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信