sir
please sir send me web services and oops concept Notes for more learning
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Dec 21, 2013, 11:46 PM EST
"" is a string literal representing a zero length string and String.Empty is a static read-only field of the String class which returns a zero length string.
I'll leave others to send you the notes.
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 22, 2013, 7:39 PM EST
yes...
both are same.
the value of Strin.Emptyfield is the zero length string "".
Praveen N104 reputationPosted Dec 22, 2013, 7:40 PM EST
There is no difference. They are equivalent.
There used to be a difference (before .NET 2.0), in that
""created a new, empty string object whileString.Emptywas a reference to a static instance of an emtpy string. This difference was removed .NET 2.0.string.empty handles memory efficently than string x="";
"" actually creates an object but string.empty does not.
Also, it is a best practise to avoid hardcoding like "";
please see the following link
http://msdn.microsoft.com/en-us/library/system.string.empty%28v=VS.80%29.aspx
String.Empty because it looks nice to me and is more readable. Also, a problem with "" is that sometimes by mistake it is written as " " which is not an empty string. However, it is just programmer's choice whether to use "" or String.Empty while the two are identical to each other.Thanks & Regards,
Praveen Nelge