Re: CSharp @

Discussion in 'ASP .Net' started by Cowboy \(Gregory A. Beamer\), Apr 17, 2008.

  1. 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
    Cowboy \(Gregory A. Beamer\), Apr 17, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piero Massari

    tool to make a class diagram from csharp

    Piero Massari, Jun 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    519
    Sahil Malik
    Jun 17, 2004
  2. Natty Gur
    Replies:
    0
    Views:
    418
    Natty Gur
    Jul 27, 2003
  3. CSDunn

    ASP.NET not processing CSharp code

    CSDunn, Jan 7, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    429
    CSDunn
    Jan 14, 2004
  4. Vili
    Replies:
    1
    Views:
    574
    Eric Cherng
    Jun 28, 2004
  5. John
    Replies:
    1
    Views:
    3,225
    Scott Allen
    Jul 26, 2004
Loading...

Share This Page