Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4038212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:26:42+00:00 2026-05-20T12:26:42+00:00

Possible Duplicate: What's the @ in front of a string for .NET? I have

  • 0

Possible Duplicate:
What's the @ in front of a string for .NET?

I have the following code:

new Attachment(Request.PhysicalApplicationPath + @"pdf\" + pdfItem.Value)

What does the @ sign do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:26:43+00:00Added an answer on May 20, 2026 at 12:26 pm

    It has nothing to do with filepath. It changes the escaping behavior of strings.

    In a string literal prefixed with @ the escape sequences starting with \ are disabled. This is convenient for filepaths since \ is the path separator and you don’t want it to start an escape sequence.

    In a normal string you would have to escape \ into \\ so your example would look like this “pdf\\”. But since it’s prefixed with @ the only character that needs escaping is " (which is escaped as "") and the \ can simply appear.

    This feature is convenient for strings literals containing \ such as filepaths or regexes.

    For your simple example the gain isn’t that big, but image you have a full path "C:\\ABC\\CDE\\DEF" then @"C:\ABC\CDE\DEF" looks a lot nicer.

    For regular expressions it’s almost a must. A regex typically contains several \ escaping other characters already and often becomes almost unreadable if you need to escape them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What's the @ in front of a string for .NET? I understand
Possible Duplicate: What's the @ in front of a string for .NET? Sometimes i
Possible Duplicate: What's the @ in front of a string for .NET? when to
Possible Duplicate: email zend framwork smtp I have following configuration: smtp.type = Zend_Mail_Transport_Smtp smtp.smtpServer
Possible Duplicate: @font-face not working on a client site? I have the following font
Possible Duplicate: How does an underscore in front of a variable in a cocoa
Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an
Possible Duplicate: New Cool Features of C# 4.0 Hello, There are several(many) questions at
Possible Duplicate: Browser Independence issue Code Working for IE but not for Firefox and
Possible Duplicate: How to skip first child? I have a ul with 4 li

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.