I’ve been tasked with making some significant modifications to a legacy codebase that was not written using our current code style conventions. The changes are extensive enough that I’m doing some cleanup and refactoring (there was quite a bit of dead code) before getting started. One of the things that’s bugging me is that the fields are following the m_FieldName naming convention whereas we now use _fieldName.
Is there some way with Resharper to automatically rename all fields in the project to follow the new convention? Are there other tools that can readily do this? It’s not too difficult to remove the prefixing ‘m’ with even a simple search/replace, but I haven’t found an automated way to change the case of the starting letter.
It might be better to just find/replace
<m_by_using Visual Studio (regular expression search/replace).The
<stands for “beginning of word”.Edit: There seems to be no way, using Find/Replace, to modify the casing of that first letter after the underscore.
So you would have to do this operation 26 times in a row, like so:
and then you’re all set. Fun, too 🙂 But it should only take a few minutes.