After writing code to populate textboxes from an object, such as:
txtFirstName.Text = customer.FirstName; txtLastName.Text = customer.LastName; txtAddress.Text = customer.Address; txtCity.Text = customer.City;
is there way in Visual Studio (or even something like Resharper) to copy and paste this code into a save function and reverse the code around the equal sign, so that it will look like:
customer.FirstName = txtFirstName.Text; customer.LastName = txtLastName.Text; customer.Address = txtAddress.Text; customer.City = txtCity.Text;
Before VS2012:
{[a-zA-Z\.]*} = {[a-zA-Z\.]*};
\2 = \1;
With VS2012 (and presumably later) which uses .NET regular expressions:
([a-zA-Z\.]*) = ([a-zA-Z\.]*);
${2} = ${1};
.*
(regular expressions) icon is selected (the third one along under the replacement textbox)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With