in C#, What does the "@" symbol do? -
possible duplicate:
what's @ in front of string .net?
sometimes saw sample code, have "@" symbol along string. example:
entityconnectionstringbuilder entitybuilder = new entityconnectionstringbuilder(); entitybuilder.provider = "system.data.sqlserverce.3.5"; entitybuilder.providerconnectionstring = providerstring; entitybuilder.metadata = @"res://*/app_data.data.csdl|res://*/app_data.data.ssdl|res://*/app_data.data.msl";
on 4th line, usage of "@"? try remove this, still works.
a string literal such @"c:\foo" called verbatim string literal. means, "don't apply interpretations characters until next quote character reached". so, verbatim string literal can contain backslashes (without them being doubled-up) , line separators. double-quote (") within verbatim literal, need double it, e.g. @"my name ""jon""" represents string name "jon". verbatim string literals contain line separators contain white-space @ start of line, tend not use them in cases white-space matters. they're handy including xml or sql in source code though, , typical use (which doesn't need line separators) specifying file system path.
Comments
Post a Comment