标题:[求助]字符串!
取消只看楼主
mrsaigp1984
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-5-10
 问题点数:0 回复次数:0 
[求助]字符串!
string strRowFilter = "";
string strTxt1 = this.textBox1.Text.Trim();
string strCmb1 = this.comboBox1.Text.Trim();
string strCmb2 = this.comboBox2.Text.Trim();
string strCmb3 = this.comboBox3.Text.Trim();
if (strTxt1 != "")//设置表的查询条件
strRowFilter += "姓名 like '%" + strTxt1+ "%' and ";
if (strCmb1 != "")
strRowFilter += "性别 like '%" + strCmb1+ "%' and ";
if (strCmb2 != "")
strRowFilter += "民族 like '%" + strCmb2+ "%' and ";
if (strCmb3 != "")
strRowFilter += "籍贯 like '%" + strCmb3+ "%' and ";
if (strRowFilter != "")//存在查询条件
{
strRowFilter = strRowFilter.Substring(0, strRowFilter.Length-5);
tempTable.DefaultView.RowFilter = strRowFilter;
}
请问其中的strRowFilter=strRowFilter.Substring(0,strRowFilter.Length-5);是什么意思?
搜索更多相关主题的帖子: string 字符 Trim strRowFilter 
2007-03-15 14:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-124401-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.127412 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved