Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: CSharp @

Reply
Thread Tools

Re: CSharp @

 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      04-17-2008
It states the string is a literal, warts and all. Without the @, you are
accepting \ as an escape character.

Your second string would fail, as it is not escaping anything valid.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"David" <> wrote in message
news:...
> Hi,
>
> I know this isn't a C# group, but its just a quick one.
>
> As a seasoned C++ developer I'm learning C# as I go along. What's the @
> symbol for before a string?
>
> eg:
>
> FileInfo myFile = new FileInfo(@"c:\Temp\Test\readme.txt");
>
> Why can't it just be:
>
> FileInfo myFile = new FileInfo("c:\Temp\Test\readme.txt"); ?
>
> Thanks
>
> David



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tree view with asp.net and csharp? Vili ASP .Net 1 06-28-2004 04:33 PM
tool to make a class diagram from csharp Piero Massari ASP .Net 1 06-17-2004 09:14 PM
HOW TO: Create a single DataSet bound object used by 50 DropDownList box controls in the same web form. CSHARP Bill ASP .Net 3 03-01-2004 05:31 PM
ASP.NET not processing CSharp code CSDunn ASP .Net 5 01-14-2004 07:59 PM
Re: Project templatefor for ASP.NET in VB (Not CSharp), Natty Gur ASP .Net 0 07-27-2003 06:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57