Is there a command or an addin in Visual Studio 2012 that would convert a selected piece of C# source code from SOME_NAME
to SomeName
?

- 50,809
- 10
- 93
- 167
4 Answers
I use resharper 7.0. It has rules on naming conventions so when I have stuff named SOME_NAME it will let me know and It will change it to the name based on the rule convention.
it will also apply naming convention to change that variable name to the code in which uses it.
I have no idea if resharper will do it all for you at once though. I've only used it for one off stuff.

- 1,886
- 14
- 12
-
Sorry, that's not what I'm after - I need a way to physically convert a bunch of identifiers to C# naming convention. – Branko Dimitrijevic Apr 15 '13 at 16:50
-
Resharper will allow you to do that. – Security Hound Apr 15 '13 at 16:55
-
@Ramhound No to my knowledge. What exactly should I do? – Branko Dimitrijevic Apr 15 '13 at 16:59
-
After re-reading your post, I realized I can actually use that for my needs. It still won't work on strings (only on identifiers in code), but that's of a lesser concern for me right now. @Ramhound I can see now what you meant. – Branko Dimitrijevic Apr 15 '13 at 17:01
When I had to do this in the past, I used the following steps:
- Select the text
OME_NAME
and press Ctrl+U (convert text to lower case). - Select the text
_n
and typeN
. - Press Alt+Shift+F10 (show smart tag) to apply a rename refactoring.

- 97,721
- 20
- 209
- 280
Short answer no, but You can do a macro and use it or use some productivity tools as resharper.

- 2,785
- 1
- 20
- 28
As far as I know the only built in case shortcuts are to change to all uppercase or all lowercase. Here's the MSDN documentation for the case shortcuts in Visual Studio 2012: http://msdn.microsoft.com/en-us/library/ms165341.aspx

- 1,386
- 6
- 28
- 62
-
I'm aware of `CTRL [ + SHIFT] + U`. Unfortunately, I need a bit more than that. – Branko Dimitrijevic Apr 15 '13 at 16:54