What is the difference between String and string in C# ?

System.String is a .NET Framework type whereas string is simply an alias for the System.String class . They both compile to the similar code in IL (Intermediate Code), so at execution time there is no difference.

string cannot be used as a variable name since it is a reserved word unless we use it with the @ symbol. If one needs to declare a variable called String , there are possibilities to do it as shown below.