Difference between String and string

If you notice in your codes, String, which typed, with an uppercase S is colored in light blue.

If it is typed in the lowercase string, it is colored in dark blue.

What is the difference between String and string actually?

Nothing really, string is a C# language keyword, which is an alias for System.String in .NET framework.

So do int = System.Int32, bool = System.Boolean and short = System.Int16.

The only subtle difference is that string can be used without a using System; directive, while String needs it,

otherwise you will need to specify System.String in full.

Hope this can provides you a clearer understanding about string and String.

Advertisements

One thought on “Difference between String and string

  1. Good one. I’ve been observing the both classes from a long time, still I could not do R& D to make it clear. Good effort.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s