difference between String and string

C

CCLeasing

I notice in my code that is String is typed with an uppercase S it is
coloured light blue in the IDE and if it is typed in the lowercase
string then it is displayed in dark blue.

Can someone explain why this is, and what the difference between these
two versions of string is please.
 
L

Lebesgue

string is a C# language keyword. It's usage translates to System.String,
which is the String you are referring to. These are absolutely he same in
C#. You can also use the System.String constructors using "string" notation
as follows: string s = new string('a', 10); or call the static methods of
the System.String class using the "string" keyword.
 
B

Bob Powell [MVP]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top