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

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

2012-01-19 
字符截取!高手Lookexecsp_GetCustomerInfo@CityId,@CustomerName,@CustomerTel,@GroupId,@append,@pagesiz

字符截取!高手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 "]);
}


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

热点排行