Yes, the title is a bit confusing if you are very new in the .NET community. If you have enough experience in C# then you might be thinking how the CLS works and the concept behind the screen, bla ..bla.
This article is only for new developers. If you go for a .NET interview then the interviewer might ask one question. "What is the difference between string and String in C# .NET". Please observe the case of "string", the first string is uncapitalized and and the other is capitalized. The interviewer may ask this question to check your theoretical knowledge.
In my old college days, one of my friends (who reads less and asks more, Ha ..Ha..) asked me this question. Still I can remember, I took a few hours to give him an answer and show him practically, exactly what happens behind the scenes. Ok, in this article we will see exactly what the difference is (if any) beween them, not only string but there are many like that.
For example, the difference between int and Int32 and so on.
How many languages you have used in the .NET platform?
If you are a young developer (like me) then the answer is 1 (only C#) and our respected senior people will say 2 (C# and VB). Oh, you have written more than that? You are good among good developers. Let's return to our explanation. Microsoft is demanding that the .NET framework support more than 32 programming languages to develop applications. So, we can use nearly all high-lavel languages, including Java, PHP, C++, Python and many more.
Now, the question is, are the same data types available in all programming languages? The answer is no. In PHP there is no concept of int, char and so on . Everything is represented by var. Whereas in C++ , C# supports int, char, float and many more pre-defined data types.
Ok, so hold onto the concept taht the .NET framework supports multiple languages to develop programs where each language does not have a similar data type or the same data type.
How does the .NET Framework process them?
Here is the main understanding. All data types are converted into a .NET data type. The question is, how? If we remind ourselves of the basic concept of the code execution process, we will see that when we compile any program in the .NET environment it will produce IL code rather than native code. Here is the execution chart.
Then the JIT compiler takes that IL code and generates corresponding native code. In the above image we see how the code is transfered to the .NET environment.
So, the concept is that whatever the data type and programming language is, we may use it to develop an application but at the day's end it is converted into .NET 's own data type.
The point
Now we will solve our question with a sample example. The difference between the capital 'S' in "String" and the small 's' in "string". Have a look at the following example.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
sing System.Diagnostics;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
string name1 = "sourav kayal";
String name2 = "sourav kayal";
Console.ReadLine();
}
}
}
The example is very simple, we have defined only two string variables but one string starts with a capital 's' and the other with a small 's'. We have compiled the code and built it. If we then open it in ILDASM then we will find the following code. Here we are seeing that all have been converted simply to "string". 
Ok, so the concept is "String is a data type of C# whereas string is a data type of .NET and in IL code everything is converted into a .NET data type.
What about int and Int32 ,Int64 ?
Those conversions are also very similar with string conversion. In the following example we will see how they convert one data type into another data type. Try to understand the following code.



Mahak GuptaPosted Nov 23, 2013, 4:36 AM
Nice Article
Khargesh RajputPosted Nov 18, 2013, 7:54 AM
nice article
sri ram Reddy tatiparthiPosted Nov 15, 2013, 1:00 AM
That's a nice article simple and understandable..
faiza zaiPosted Nov 8, 2013, 2:12 PM
thanks it is very informative article (Y)
AniPosted Nov 6, 2013, 7:15 AM
Fruitful Info and thank you. will the memory allocation differ between .net datatype and c# datatype
Santosh KumarPosted Nov 3, 2013, 1:04 AM
Nice Info..
Rajan SinghPosted Oct 30, 2013, 8:52 AM
Very good explanation.
Saineshwar BageriPosted Oct 29, 2013, 12:49 AM
Nice one
Sam HobbsPosted Oct 28, 2013, 4:06 PM
Also see "string (C# Reference)" in the MSDN, which says "string is an alias for String in the .NET Framework". Link: http://msdn.microsoft.com/en-us/library/362314fe.aspx
Abdul Waheed MohammedPosted Oct 28, 2013, 3:48 AM
Good Info...
Srinubabu RavillaPosted Oct 28, 2013, 2:04 AM
Very good explanation. Theoretical knowledge is more important before going to write the coding.. Thanks for sharing this info.
Sunny SharmaPosted Oct 28, 2013, 12:30 AM
Nice share !!
Sourav KayalPosted Oct 27, 2013, 10:24 PM
Thanks Sam sir, for your informative comment. I will check them very soon.
Sam HobbsPosted Oct 27, 2013, 3:22 PM
Try using "String" (capitalized) in a program without "using System;" at the top. Then see what happens when you put "using System;" at the top. Finally, note that we can use "string" (uncapitlized) without "using System;". See the C# language specification for an explanation of why "string" (uncapitlized) works without "using System;".
Sam HobbsPosted Oct 27, 2013, 3:02 PM
Also see ECMA standard 334, "C# Language Specification". The Introduction says "CLI is based on a subset of the .NET Framework". See "Annex D. Standard Library", which says a "conforming C# implementation shall provide a minimum set of types". The C# standard types are listed there; all implementations of C# must provide those types. The standard also says, in "8.2.1 Predefined types", that "Each of the predefined types is shorthand for a system-provided type. For example, the keyword int refers to the struct System.Int32."
Sam HobbsPosted Oct 27, 2013, 2:49 PM
Please see ECMA standard 335, "Common Language Infrastructure (CLI)". I think it is better to refer to it, at least some of the time, instead of referring to .Net. The CLI is a standard but .Net is not. The C# language specification is defined in terms of the CLI, not .Net.
Ravi ShekharPosted Oct 27, 2013, 10:21 AM
Amazing concept and writing skill. Hats off sir
Jaganathan BantheswaranPosted Oct 27, 2013, 4:11 AM
Nice :)