Tom West
Tom West

Reputation: 1837

Can I make C# Intellisense in VS 2013 use "String" instead of "string"

I am old-fashioned, and prefer "String" (class) to "string" (basic type) in C#. In Visual Studio, Intellisense always substitutes "string" for "String" so that I get things like:

static Dictionary<String, Dictionary<String, Tuple<String, String>>> s_edits = new Dictionary<string,Dictionary<string,Tuple<string,string>>>
                                                                                   __________________________________________________________

where the underlined section was added by Intellisense. Is there any way I can persuade VS to use "String"?

As you can imagine, trying to Google for "String" vs "string" isn't working :-(.

Upvotes: 1

Views: 315

Answers (1)

Zein Makki
Zein Makki

Reputation: 30032

You can actually supress the warning that visual studio shows in 2 ways.

To do that on the project level:

Solution Explorer > Right Click Project > Properties > Build.

Next to Supress Warning, write IDE0001

To do it globally for All projects, you can:

Tools > Options > Text Editor > C# > Code Style > uncheck :

Prefer intrinsic predefined type keyword when declaring locals, parameters and members

Upvotes: 4

Related Questions