![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | @"string" Why do I see a @ preceding strings in code examples? What does the @ do? thanks! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: @"string" Do you mean for 'parameters' in sql statements? Can you post an example of what you see? "Mike Gleason jr Couturier" <nospam@xxxxxx> wrote in message news:urljRJQ4IHA.3500@xxxxxx Quote: > Why do I see a @ preceding strings in code examples? > > What does the @ do? > > > thanks! > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: @"string" Hello Mike Gleason jr Couturier, Quote: > Why do I see a @ preceding strings in code examples? > > What does the @ do? certain characters as escape codes. for example ------------------------------------------------------------- string SomeString = "\n"; //This produces an enter keystroke string OtherString = @"\n"; //This produces a string containing the backslash and 'n' characters. ------------------------------------------------------------- -- Rory |
My System Specs![]() |
| | #4 (permalink) |
| | Re: @"string" "Rory Becker" <rorybecker@xxxxxx> wrote in message news:3af1034718d0c8caaf282538db6d@xxxxxx Quote: > Hello Mike Gleason jr Couturier, > Quote: > > Why do I see a @ preceding strings in code examples? > > > > What does the @ do? > I believe it is a c# sytax that prevents the compiler otherwise Quote: > certain characters as escape codes. > > for example > ------------------------------------------------------------- > string SomeString = "\n"; //This produces an enter keystroke > string OtherString = @"\n"; //This produces a string containing the Quote: > and 'n' characters. > ------------------------------------------------------------- > string someSQL = @" SELECT a.Field1, a.Field2 FROM ATable a INNER JOIN BTable b ON b.ID = a.ID WHERE b.Field3 = 15" The down side is that " need to be duplicated as "" e.g.:- string someXML = @"<root thing=""x"" />" -- Anthony Jones - MVP ASP/ASP.NET |
My System Specs![]() |
| | #5 (permalink) |
| | Re: @"string" Mike Gleason jr Couturier <nospam@xxxxxx> wrote: Quote: > Why do I see a @ preceding strings in code examples? > > What does the @ do? -- Jon Skeet - <skeet@xxxxxx> Web site: http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon_skeet C# in Depth: http://csharpindepth.com |
My System Specs![]() |
| | #6 (permalink) |
| | Re: @"string" Ok thanks guys... I was seeing the @ when declaring connection strings in books... (web projetcs, web.config) Thanks! |
My System Specs![]() |
| | #7 (permalink) |
| | Re: @"string" You should also read up on "SQL Injections"... just google it up It will give you good examples of why the @ is used as a parameter. "Mike Gleason jr Couturier" <nospam@xxxxxx> wrote in message news:OL51DOS4IHA.1196@xxxxxx Quote: > Ok thanks guys... > > I was seeing the @ when declaring connection strings in books... (web > projetcs, web.config) > > Thanks! > |
My System Specs![]() |
| | #8 (permalink) |
| | Re: @"string" On Jul 8, 9:55*pm, "Mike Gleason jr Couturier" <nos...@xxxxxx> wrote: Quote: > Why do I see a @ preceding strings in code examples? > > What does the @ do? > > thanks! without @: var str="e:\\folder1\\folder2\\folder3\\file" with @: var str=@"e:\folder1\folder2\folder3\file" |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| wscript.echo only a new line / embed a "CR" in a text string ? | VB Script | |||
| DVD Maker "invalid class string" during transcode | Vista music pictures video | |||
| Vista not wotking with "My Computer" or "Control Panel", "Screen Saver" | Vista General | |||
| how to get "select @@version" to display one long string | PowerShell | |||
| "string STR_ERR_OS was not found in string table" | Vista installation & setup | |||