Example (note the case):
string s = \"Hello world!\";
String s = \"Hello world!\";
What are
System.String
is the .NET string class - in C# string
is an alias for System.String
- so in use they are the same.
As for guidelines I wouldn't get too bogged down and just use whichever you feel like - there are more important things in life and the code is going to be the same anyway.
If you find yourselves building systems where it is necessary to specify the size of the integers you are using and so tend to use Int16
, Int32
, UInt16
, UInt32
etc. then it might look more natural to use String
- and when moving around between different .net languages it might make things more understandable - otherwise I would use string and int.