读书人

字符截取!高手Look,该怎么处理

发布时间: 2012-01-19 20:57:58 作者: rapoo

字符截取!高手Look
exec sp_GetCustomerInfo @CityId,@CustomerName,@CustomerTel,@GroupId,@append,@pagesize,@pageindex,@docount字符截取
最终得到
@CityId
@CustomerName
@CustomerTel

这样
CityId
CustomerName
CustomerTel
的一个字符串数组 ???

select * from Customer where HomePhone=@Phone or OtherPhone=@Phone or MobilePhone=@Phone又如这样的???

[解决办法]
Regex re14 = new Regex(@ "@(? <par> [^,\s)]*)[,\s)] ");
MatchCollection mc1 = re14.Matches( "exec sp_GetCustomerInfo @CityId,@CustomerName,@CustomerTel,@GroupId,@append,@pagesize,@pageindex,@docount ");
for (int j = 0; j < mc1.Count; j++)
{
Response.Write( " </br> par: " + mc1[j].Groups[ "par "]);
}


另外需要在待匹配的字符串最后加一个空格 :)

读书人网 >asp.net

热点推荐