[Association(Name="pxb_zd_pxb_jf", Storage="_pxb_zd", ThisKey="lx_id", OtherKey="id", IsForeignKey=true)] public其中 public是在第2行,要求将public 替换成internal 如何写表达式,谢谢
2 回答
慕码人2483693
TA贡献1860条经验 获得超9个赞
protected void btnMatch3_Click(object sender, EventArgs e) { string strSrc="[Association(Name=\"pxb_zd_pxb_jf\", Storage=\"_pxb_zd\", ThisKey=\"lx_id\", OtherKey=\"id\", IsForeignKey=true)] "+System.Environment.NewLine+" public "; ResultString = GetContentByHtml3(@"(\[Association.*\n*\r*.*\n*\r*.)public", strSrc,"public","internal"); } private string GetContentByHtml3(string strRegEx, string strHtml,string strOrg,string strReplace) { if (string.IsNullOrEmpty(strRegEx)) { return strHtml; } Regex reg = new Regex(strRegEx); Match mat = reg.Match(strHtml); if (mat.Success) { strHtml=mat.Value; strHtml = strHtml.Replace(strOrg, strReplace); //strHtml = mat.Value; } return strHtml; }
- 2 回答
- 0 关注
- 493 浏览
添加回答
举报
0/150
提交
取消