在VS里
con.ContId = this.textBoxContID.Text;
类似这种代码有近百行,想改成
this.textBoxContID.Text=con.ContId;想直接用编辑器的查找替换功能,正则要怎么写?
con.ContId = this.textBoxContID.Text;
类似这种代码有近百行,想改成
this.textBoxContID.Text=con.ContId;想直接用编辑器的查找替换功能,正则要怎么写?
Regex.Replace(str, patternstr, "$2=$1;");
试试
string patternstr = @"([^=]*)=([^;]*);";
str = Regex.Replace(str, patternstr, "$2=$1;");
Response.Write(str);