Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
What is the difference between String and string?
Posted

Hi,

please refer to "Built-In Types Table (C# Reference)"

http://msdn.microsoft.com/en-us/library/ya5y69ds.aspx[^]

Happy coding,
Stephan
 
Share this answer
 
string is an alias for System.String. So technically, there is no difference. It's like int vs. System.Int32.

For More information..
See http://stackoverflow.com/questions/7074/whats-the-difference-between-string-and-string[^]
 
Share this answer
 
C# string is just an alias of the CLI String data type.
 
Share this answer
 
There is no difference. string is an alias for System.String in the same way int is an alias for System.Int32.

PS: There are many posts on the web which discusses the same. Please do a search before you ask.
 
Share this answer
 
Comments
Raul Iloc 27-Nov-14 5:40am    
I agree with you. You have my vote (5).
In short “String is data type of C# but string is data type of .NET framework”
There are some difference between data type of C# and data type of .NET framework. We all know that .NET framework supports nearly 32 programming languages to develop application. And each programming language has it’s own data type , for example in C# programming language “Int” is present where in PHP everything is represented by “var” because PHP is loosely type checking programming language.

So, whatever programming language we may use in .NET platform, ultimately they convert in .NET framekork’s own data type.

For example, if we use “int” to define integer in C# ,after compilation the code it will convert to “Int32” which is data type of .NET framework same is “String” and “string” String is data type of C# but string is data type of .NET framework.

Please go through below link which has an example for it.

http://www.dotnetfunda.com/articles/show/2628/difference-between-data-type-of-csharp-and-data-type-net-framework
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900