0

As asked here What is the difference between String and string in C#? you can use string and String in the code.

To have a common code style, we decided to use string when we create objects:

string name="Elvis";

and String when we use a static method:

String.Concat("Elvis", " lives");

I wanted to configure ReSharper in order to recognize this but I just find that I can configure it to use either the first or the second way:

enter image description here

Community
  • 1
  • 1
Fleve
  • 300
  • 1
  • 5
  • 19
  • Why would you decide to be inconsistent when referring to the same thing? – Stephen Oct 01 '15 at 11:39
  • I don't find it inconsistent as I refer with string to an instance of string and with String to a static class (or to its static methods). But anyway, my question is not about the consistent of these decision, I just wanna know if it is possible to configure ReSharper to do it. – Fleve Oct 01 '15 at 11:44

1 Answers1

2

Based on the documentation, I don't believe this is currently possible. I agree it's a logical thing to want to do though, that's exactly how I'd like to configure it too. Resharper only recently added the ability to choose how to reference built-in type names though. Support for any control was apparently only added in 9.1. Here's the ticket requesting it: https://youtrack.jetbrains.com/issue/RSRP-5662

Note that despite someone else asking for exactly what you want in the comments, there was no reply to his comment from the development team, and it doesn't look like this ability was added when they implemented the feature.

For completeness, here's the relevant page of the documentation describing this option: https://www.jetbrains.com/resharper/help/Built_In_Type_Naming.html

Roger Sanders
  • 1,982
  • 1
  • 19
  • 25