当前位置: 代码迷 >> ASP.NET >> 字符截取!高手Look,该怎么处理
  详细解决方案

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

热度:3219   发布时间:2013-02-25 00:00:00.0
字符截取!高手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 "]);
}


另外需要在待匹配的字符串最后加一个空格 :)
  相关解决方案