I’d like to replace some assignment statements like:
int someNum = txtSomeNum.Text;
int anotherNum = txtAnotherNum.Text;
with
int someNum = Int32.Parse(txtSomeNum.Text);
int anotherNum = Int32.Parse(txtAnotherNum.Text);
Is there a good way to do this with Visual Studio’s Find and Replace, using Regular Expressions? I’m not sure what the Regular expression would be.
I think in Visual Studio, you can mark expressions with curly braces
{txtSomeNum.Text}. Then in the replacement, you can refer to it with\1. So the replacement line would be something likeInt32.Parse(\1).Update: via @Timothy003
VS 11 does away with the {} \1 syntax and uses () $1