what is the work of string.Empty() method.
please explain it.
What is the work of string.Empty() method
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Posted Sep 25, 2013, 1:41 AM EDT
Instead of hard-coding like "", you can use this method to assign "" to a string variable.
VulpesRank #55 · 29.2K reputationPosted Sep 25, 2013, 2:20 AM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 25, 2013, 3:11 AM EDT
As Vulpes Said its not a method.
The string.Empty field is an empty string literal. It is slightly different from an empty string literal constant "".
We use string.Empty and "" in a C# program. The string.Empty field is initialized to "" at runtime by the .NET Framework.
Muhammad younas164 reputationPosted Sep 25, 2013, 4:09 AM EDT