例如:
ti.TeaID=this.textbox1.text
换成:
this.textbox1.text=ti.TeaID
P.S:如果没有“.”可以写成这样:str = Regex.Replace(str, "(\\w+\\s*)=(\\s*\\w+)", "$2 = $1");
那么现在有"."呢,怎么写?
ti.TeaID=this.textbox1.text
换成:
this.textbox1.text=ti.TeaID
P.S:如果没有“.”可以写成这样:str = Regex.Replace(str, "(\\w+\\s*)=(\\s*\\w+)", "$2 = $1");
那么现在有"."呢,怎么写?
string[] temp = test.Split('=');
string result = temp[1] + "=" + temp[0];
string result = Regex.Replace(test, @"([^=]*)=(.*)", "$2=$1");
那如果是:ti.TeaID=this.textbox1.text;
换成:
this.textbox1.text=ti.TeaID ;
呢?我对正则表达式不懂得
string test = "ti.TeaID=this.textbox1.text;";
string result = Regex.Replace(test, @"([^=]*)=([^;]*)", "$2=$1");