there are more that 90+ files(.cs) in my Application.
I have used a statement like
string str = MyMessages.IDS_STR_STRING1;
MyMessages.IDS_STR_STRING2;
MyMessages.IDS_STR_STRING3;
in many files almost say some 40+ files.
Where MyMessages is a static class.
I now have added another function in this class say GetMyString(string identifier).
So now the above statmenets would change to
MyMessages.GetMyString("IDS_STR_STRING1");
MyMessages.GetMyString("IDS_STR_STRING2");
MyMessages.GetMyString("IDS_STR_STRING3");
and so on….
Now searching and replacing each statement is tedious and could lead to manual errors.
Can i write any macro / a tool that would find the string and replace in the appropriate format ?
You can use the Replace function in Visual Studio which supports regex’es.
Something like:
Input
Replace