string MatchException = Regex.Match(FileBlocks[i], @"\b(异常:)[\s\S]*").ToString();
string MatchExceptionMod = Regex.Replace(MatchException, @"[异常:]", "").ToString();
要截取的字符串如下:异常:
Saaaaaaystem.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.DivideByZeroException: Attempted to divide by zero.
at ttt.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b)
at TTT.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b) 上面正则是取"异常"后面的字段存取到datatable,绑定到datagridview中,怎么才能去除异常后面的空行?因为导出到excel格式出现了问题.Saaaaaaystem.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.DivideByZeroException: Attempted to divide by zero.
at ttt.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b)
at TTT.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b) 上面这个字符串本来在第二行第5列,串到了 下下行的第一列。请高手从语法上分析怎么截取合适。
string MatchExceptionMod = Regex.Replace(MatchException, @"[异常:]", "").ToString();
要截取的字符串如下:异常:
Saaaaaaystem.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.DivideByZeroException: Attempted to divide by zero.
at ttt.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b)
at TTT.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b) 上面正则是取"异常"后面的字段存取到datatable,绑定到datagridview中,怎么才能去除异常后面的空行?因为导出到excel格式出现了问题.Saaaaaaystem.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.DivideByZeroException: Attempted to divide by zero.
at ttt.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b)
at TTT.MMTT.BLL.Logistics.Cus.Excep.GetValue(Int32 a, Int32 b) 上面这个字符串本来在第二行第5列,串到了 下下行的第一列。请高手从语法上分析怎么截取合适。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货