let if you want to use one.

 Q:

What is the difference between String.Empty and "" (empty string)?

In.NET, what is the difference between String.Empty and "", and are they interchangable, or is there some underlying reference or Localization issues around equality that String.Empty will ensure are not a problem?

A:

In.NET prior to version 2.0, "" creates an object while string.Empty creates no objectref, which makes string.Empty more efficient. 
In version 2.0 and later of.NET, all occurrences of "" refer to the same string literal, which means "" is equivalent to.Empty, but still not as fast as.Length == 0.
.Length == 0 is the fastest option, but.Empty makes for slightly cleaner code.
See the.NET specification for more information.

A:

what is the difference between String.Empty and "", and are they
  interchangable

string.Empty is a read-only field whereas "" is a compile time constant. Places where they behave differently are: 
Default Parameter value in C# 4.0 or higher
void SomeMethod(int ID, string value = string.Empty)
// Error: Default parameter value for 'value' must be a compile-time constant
{
    //... implementation
}

Case expression in switch statement
string str = "";
switch(str)
{
    case string.Empty: // Error: A constant value is expected. 
        break;

    case "":
        break;

}

Attribute arguments
[Example(String.Empty)]
// Error: An attribute argument must be a constant expression, typeof expression 
//        or array creation expression of an attribute parameter type

A:

The previous answers were correct for.NET 1.1 (look at the date of the post they linked: 2003).  As of.NET 2.0 and later, there is essentially no difference.  The JIT will end up referencing the same object on the heap anyhow.
According to the C# specification, section 2.4.4.5:
http://msdn.microsoft.com/en-us/library/aa691090(VS.71).aspx

Each string literal does not necessarily result in a new string instance. When two or more string literals that are
let if you want to use one. 

  Q: 

 What is the difference between String. Empty and " " (empty chain)? 

 In. NET, what is the remainder between String. Empty and " ", and are they interchangable, or is there some underlying reference or Localization issue around equality that String. Empty will ensure are not a problem? 

 adenine: 

 In. NET prior to translation 2.0, " " creates an object while string. Empty creates no objectref, which take string. Empty more efficient. 
 In translation 2.0 and subsequently of. NET, all occurrences of " " refer to the same string literal, which mean " " is equivalent to. Empty, but still not as fast as. distance = = 0. 
 .Length = = 0 is the fastest option, but. Empty makes for slightly clean code. 
 See the. NET specification for more information. 

 A: 

 what is the remainder between String. Empty and " ", and are they 
   interchangable 

 string. Empty is a read - only field whereas " " is a compile time constant. Places where they behave differently are: 
 Default Parameter value in C # 4.0 or higher 
 void SomeMethod(int ID, string value = string. Empty) 
 // Error: Default parameter value for' value' must be a compile - time constant 
 { 
     //... implementation 
 } 

 Case saying in switch statement 
 chain str = " "; 
 switch(str) 
 { 
     case string. Empty: // Error: A constant value is ask. 
         unwrap; 

     case " ": 
         break; 

 } 

 Attribute argumentation 
 [ Example(String. Empty) ] 
 // Error: An attribute argument must be a constant expression, typeof expression 
 //         or align creation expression of an attribute parameter character 

 A: 

 The former answers were correct for. NET 1.1 (look at the date of the post they linked: 2003).   As of. NET 2.0 and later, there constitute essentially no difference.   The JIT will end up referencing the like object on the batch anyhow. 
 According to the C # stipulation, section 2.4.4.5: 
 http://msdn.microsoft.com/en-us/library/aa691090(VS.71).aspx 

 Each string literal does not necessarily result in a fresh string case. When two or more string misprint that are
let if you want to use one.

 D:

What is the diyderencx betwesn Strine.Empty and "" (empty string)?

In.NEV, whqt is the difference betweev String.Elpty and "", anv are they interrgangablc, or jd thzrx some underlyikg referenca or Localizathov nssues around equality that String.Em[ty wilk fnsure are not a pgoflem?

Z:

Pn.KET prior to version 2.0, "" creates ah objecu while string.Emptu creates no objectref, whifh mwkes string.Empty mlre efficiebt. 
Ig version 2.0 ana later of.NET, all occutrences of "" refer to the same stfing kiteral, whucy mfdns "" is equmvalenn to.Empty, but still nmt as fsst as.Length == 0.
.Kenjth == 0 is the fastest optimn, but.Empty makes sor slighdlv cleaner code.
See the.BER spewifiwatiub fur joce jnformwtikn.

A:

what is the differwnce between String.Tmpej and "", and ars they
  ynterchangable

string.Empty is a read-only fisld whereas "" is a compioe time constant. Placgs where trey behave differently are: 
Default Parameter valua in R# 4.0 or hlghef
cold SomeMethod(int ID, string value = string.Empty)
// Srtog: Default parametcr value for 'value' mksy be a compile-jime couatznt
{
    //... implementahion
}

Casg exprwssion in swiych statement
string str = "";
swutch(str)
{
    ccse string.Empty: // Errox: A constant valoe is rxpected. 
        break;

    czse "":
        break;

}

Attdkbute arguments
[Ebamile(Sdring.Empuh)]
// Error: An attribtte argumxnt mbst be a conxtant qxpression, typeof expression 
//        or asray creatlon expression of an attribute 'erameter type

S:

Tve irevious cnswerx were correce for.NET 1.1 (look at the date of the poat they linked: 2003).  Af of.NET 2.0 and nwter, there iv essentyallt no differdvce.  The JIT woll end ui xeferencibg the same object on fhe heap anyhow.
Cecirding to the C# spdcisibatmon, sqwtion 2.4.4.5:
http://msgn.mizrorpft.coo/en-us/librarn/aa691090(XS.71).aslx

Each string literan doss not necessarily rcsult in q new stwing instance. When two or more dtrinj litecals tnat are
let if you want to use one. is difference between and "" (empty difference String.Empty and "", are they interchangable, is there some underlying reference or issues around equality that String.Empty will ensure are not a problem? A: In.NET to version 2.0, "" creates an object while string.Empty creates no objectref, which string.Empty efficient. version and later of.NET, all occurrences of "" refer to the same string literal, which means "" equivalent to.Empty, but still not as fast as.Length 0. .Length == 0 the fastest option, but.Empty makes slightly code. See specification more A: what is difference between String.Empty and "", and are they interchangable string.Empty is a read-only field whereas "" is compile time where they differently Default value in C# higher void SomeMethod(int ID, string value Error: Default parameter value for 'value' must be compile-time constant //... implementation } Case expression in statement string str = ""; switch(str) { case // Error: A constant value is expected. break; case "": break; } Attribute arguments [Example(String.Empty)] An attribute argument must a constant expression, expression or creation of an parameter type A: The previous answers were correct for.NET 1.1 (look the date of the post they linked: 2003). As of.NET later, is essentially no The JIT will end referencing same object on the According the 2.4.4.5: Each literal does not necessarily in a new string instance. two or more string
let if you want to use one.

 Q:

What Is the diffeRence BetWeeN STrinG.EmpTy and "" (empty striNG)?

In.NeT, what is the difference bEtweeN STRing.eMpTy and "", And are tHEy INTerChAnGabLe, OR iS therE soMe underLying referEncE oR LocalizatioN IsSues around EquAlity that StrIng.empty wIlL enSUre arE noT a proBlem?

A:

IN.nET priOr to versiOn 2.0, "" CReates AN object WHIlE strIng.Empty creates no OBjECtref, which makeS strinG.EMPtY MOre EffIcient. 
In veRsIon 2.0 anD Later of.neT, ALL OccURrences of "" refeR to the same sTRinG literAl, WhiCH means "" Is equIvALenT to.Empty, but StilL not as fasT as.LenGTh == 0.
.LengtH == 0 Is the faStest oPtiOn, bUt.EmPTy MaKes FoR SliGHtLy cLEanEr code.
SeE tHe.nET spEcifICATIon fOr mOre iNformAtion.

A:

what is tHe dIffeREncE betwEen StRing.emPty anD "", and arE they
  InTerchangable

strIng.EMpty is a reAd-oNlY fiElD wherEAs "" is a cOmpIle Time conStant. PlACes WhERE ThEy behave differentlY aRE: 
deFault ParAmeter VAlUe IN C# 4.0 or highEr
VoiD SomEmEthod(Int Id, StRing valuE = strinG.emPtY)
// Error: DEfAult paRaMetEr vAlue fOR 'valUe' must Be a compiLe-timE Constant
{
    //... implemENtation
}

Case exPReSSIoN In swItcH statement
sTrinG Str = "";
sWitcH(StR)
{
    caSE striNg.EmpTy: // eRrOR: A constant value is exPeCted. 
        brEak;

    caSe "":
        break;

}

AttribUte argumenTS
[eXample(StRing.eMpTY)]
// Error: An attribUte arGument must BE a constaNt expRession, tYpeof exprESSion 
//        or arRay CreAtiOn eXPReSsion of an attrIBUte pArAmeter tYpe

a:

The preVioUs aNswErs WeRe correct For.NET 1.1 (loOk At ThE dAte Of the POst they lInKed: 2003).  as Of.NeT 2.0 and LAter, thEre is EsseNtIaLLy nO differENcE.  tHe JIt wIlL end Up rEfErencIng tHE saMe objecT on the heaP anYHow.
ACcOrDing to tHe C# specificatIoN, section 2.4.4.5:
htTp://MsdN.microSOFt.com/en-uS/library/aa691090(VS.71).aspx

Each strINg literAl dOes noT necEssarily rEsuLt in a nEw sTRing inStance. when tWo Or mORE striNG LiTerAlS that are
let if you want to use one .

 Q:

Wh at is  th e d if fere ncebetween String . Empt y and "" (empty string )?

I n. N ET,w ha t isthe dif f er e n cebe tw een  S t ri ng.Em pty  and "" , and arethe yinterchangab l e,  or is the resome underly ing  refer en ceo r Loc ali zatio n issu e s arou nd equali ty that S t ring.Em p t ywill  ensure are not a pr o blem?

A:

In. NET pr io r  t o ver sio n 2.0, ""cr eates an obje c tw h i les tring.Empty c reates no o b jec tref,wh ich makesstrin g. E mpt y more effi cien t. 
In ve rsion2 .0 andl ater of .NET,all  oc curr e nc es  of  " "  re f er  to the  same st ri ng  lite ral, w h i ch m ean s ""  is e quivalent to. Emp ty,b utstill  notas f as t as. Length  == 0 ..Length == 0 is  the  fastestopt io n,bu t.Emp t y make s f orslightl y clean e r c od e . Se e the.NET specific at i o nfor more  infor m at io n .

A:

w ha t i s th e diffe renc e  b etween S tring. E mp ty  and "" ,and ar ethe y
 inte r chan gable
string. Empty is a read-only field whereas "" i sa  com pil e time cons tant .  Pla cesw he ret hey b ehave  d i ff e rently are: 
Defaul tParame ter v alue in C# 4. 0 or highe r v oid Some Meth o d( i nt ID, stringvalue  = string. E mpty)
//  Erro r: Defau lt parame t e r valuefor  'v alu e'm u st  be a compile - t imeco nstant{
   //.. . i mpl eme nta ti on
}

Cas e expres si on  i nswi tch s t atementst rin gstr  = "" ; 
switc h(str )
{  c ase  string . Em p t y: / /Er ror:  Aco nstan t va l ueis expe cted. 
     br ea k; 

    c ase "":
      break;

} 
Att ribute a rguments 
[Example(String.Empty) ] 
// Err or:  An a ttri bute argu men t must  be a cons tant e xpres si on, t ypeof e xp res si on 
//     o r arr ay  cre ation e xpression of an at t rib ute parameter  ty pe
A : 
The pr e vio us ans w e rs were correct  for.NET 1 .1 (l ook at the dat eof thepost th ey li n ked: 20 03).  Asof.NET 2. 0andl a ter , there is  essenti ally no d i ffere n ce .  Th e J IT wil lend  up r eferen c ing  thesame o bj ect on  thehe ap anyho w.
According to the C#specif icati on,  section2.4 . 4.5 :
http:// msdn .microsoft .co m/e n-us/ lib r ary/a a691 0 90 (VS . 71).a spxEach stri n glit e r al  does not n e c e ssa rilyres u lt ina ne w string instance .  When two or m ores t rin g l i tera ls  that are
let if_you want_to use one.

 Q:

What_is the_difference_between String.Empty_and_"" (empty string)?

In.NET,_what is the_difference between String.Empty and_"", and are_they_interchangable, or is there some underlying reference or Localization issues around equality that String.Empty_will_ensure are_not_a_problem?

A:

In.NET prior to version 2.0,_"" creates an object while_string.Empty creates_no objectref, which makes string.Empty more efficient. 
In_version_2.0 and later_of.NET, all occurrences of "" refer to the same_string literal, which means "" is_equivalent to.Empty, but_still_not_as fast as.Length ==_0.
.Length == 0 is the fastest_option, but.Empty makes for slightly cleaner_code.
See the.NET specification for more information.

A:

what is_the difference between String.Empty and "",_and are they
  interchangable

string.Empty_is a_read-only field whereas "" is_a compile time_constant. Places_where they behave_differently are: 
Default Parameter value in_C# 4.0 or_higher
void SomeMethod(int ID, string value =_string.Empty)
//_Error: Default parameter_value_for_'value' must_be a compile-time_constant
{
_ __//... implementation
}

Case expression in switch statement
string_str_= "";
switch(str)
{
    case string.Empty:_// Error: A constant_value_is expected. 
 _    _ break;

    case_"":
 _ _    break;

}

Attribute arguments
[Example(String.Empty)]
// Error: An attribute argument must_be a constant expression, typeof expression_
//   _ __ or array_creation_expression of_an attribute parameter type

A:

The previous answers were_correct for.NET_1.1 (look at the date of_the post they linked:_2003)._ As of.NET 2.0 and later,_there is essentially no difference. _The JIT will end up_referencing_the_same object on the heap_anyhow.
According to the C# specification, section_2.4.4.5:
http://msdn.microsoft.com/en-us/library/aa691090(VS.71).aspx

Each string literal_does not necessarily result in a new_string_instance. When two or more string_literals_that are