0

For some reason my pinky finger likes to keep the shift key down a bit longer than I normally like. So I end up typing STring.Empty quite a bit. Visual studio helpfully converts that to string.Empty which is not the desired behavior. I would much rather it be converted to String.Empty. Notice the differences in capitalization.

I am quite aware that string is simply an alias for String; so this boils down to a simple personal preference on how things are color coded in the IDE.

Is there a way I can tell visual studio to always auto correct to String instead of to the alias? This could save me an untold number of times pressing the back button on a daily basis.

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245

1 Answers1

0

The IDE will only "auto-correct" to types is knows are valid in the current scope. string is always valid, but String is only valid if you've referenced the System namespace with a using directive. If you did reference System then VS 2012 will "auto-correct" to String, not string--which has been my experience.

Peter Ritchie
  • 35,463
  • 9
  • 80
  • 98