Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In C#, what is the difference between String and string?

Example:

C#
string s = "Hello, World";

String S = "Hello, World";


What are the guidelines for the use of each?
Posted
Comments
jaket-cp 10-Dec-14 5:21am    
A similar question was asked recently, it knocks my memory as I was inclined to say one is capitalize and the other one is not :)
Please have a look at the answers:
http://www.codeproject.com/Questions/847223/What-is-the-difference-between-String-and-string
and also
http://www.codeproject.com/Questions/196823/The-difference-between-String-and-string

string is a c# alias for System.String. They are actually the same type.

Good luck!
 
Share this answer
 
Comments
Raul Iloc 10-Dec-14 4:22am    
I agree with you!
You have my vote (5).
Maciej Los 10-Dec-14 4:35am    
+5
CP_vicky 10-Dec-14 5:05am    
Thank you
 
Share this answer
 
v2

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