Quantcast
Channel: What is the difference between String and string in C#? - Stack Overflow
Viewing all articles
Browse latest Browse all 69

Answer by Anuja Lamahewa for What is the difference between String and string in C#?

$
0
0

Both are the same.The difference is how you use it.Convention is,

string is for variables

String is for calling other String class methods

Like:

string fName = "John";string lName = "Smith";string fullName = String.Concat(fName,lName);if (String.IsNullOrEmpty(fName)){  Console.WriteLine("Enter first name");}

Viewing all articles
Browse latest Browse all 69

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>