It marks the string as a verbatim string literal – anything in the string that would normally be interpreted as an escape sequence is ignored.
So "C:\\Users\\Rich"
is the same as @"C:\Users\Rich"
There is one exception: an escape sequence is needed for the double quote. To escape a double quote, you need to put two double quotes in a row. For instance, @""""
evaluates to "
.
Related Posts:
- Best way to repeat a character in C#
- What is the difference between String and string in C#?
- How can I convert String to Int?
- What is a singleton in C#?
- My C# application is returning 0xE0434352 to Windows Task Scheduler but it is not crashing
- C# Set collection?
- Why is Dictionary preferred over Hashtable in C#?
- Does anyone still use [goto] in C# and if so why?
- How does the “Using” statement translate from C# to VB?
- What is the best way to parse html in C#? [closed]
- Best C# API to create PDF
- C# cannot convert method to non delegate type
- What is the difference between const and readonly in C#?
- Pass Method as Parameter using C#
- ArrayList vs List<> in C#
- How to solve ‘…is a ‘type’, which is not valid in the given context’? (C#)
- Calling the base constructor in C#
- How to empty a list in C#?
- Substring index and length must refer to a location within the string
- How to open an Excel file in C#?
- What is a method group in C#?
- How to convert UTF-8 byte[] to string
- .NET String.Format() to add commas in thousands place for a number
- How do I save a stream to a file in C#?
- Print Pdf in C#
- Can a Byte[] Array be written to a file in C#?
- What is a quick way to force CRLF in C# / .NET?
- Creating a List of Lists in C#
- Unrecognized escape sequence for path string containing backslashes
- C# int to byte[]
- .Net 4.8 Support for Windows 10 ends in 26 days?
- What is a NullReferenceException, and how do I fix it?
- How do I get a random YouTube video with the YouTube API?
- An existing connection was forcibly closed by the remote host
- What is a NullReferenceException, and how do I fix it?
- I am getting Failed to load resource: net::ERR_BLOCKED_BY_CLIENT with Google chrome
- What’s the difference between .NET Core, .NET Framework, and Xamarin?
- ‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine
- Could not load file or assembly or one of its dependencies
- Convert int to string?
- What is WCF? and what can it do?
- Priority queue in .Net
- What is the difference between int, Int16, Int32 and Int64?
- How can I add ” character to a multi line string declaration in C#?
- How to open .dll files to see what is written inside?
- Windows .NET API / Windows 7 / Bluetooth communication with Intel Curie Arduino / Genuino 101
- System.web.mvc missing
- Nullable object must have a value?
- Extension methods must be defined in a non-generic static class
- “Error while trying to run project: Unable to start program”. Can run program only once. Then VS needs restart
- How to resolve this System.IO.FileNotFoundException
- What is clr.dll on .Net framework and what does it do?
- Associating enums with strings in C#
- How to resolve this System.IO.FileNotFoundException
- Why does .Net Socket.Disconnect take two minutes?
- Extension methods must be defined in a non-generic static class
- ClickOnce runtime DFSVC.EXE
- How can I get the application’s path in a .NET console application?
- How do I create a Shared Code project (.shproj)
- SQL Connection Error: System.Data.SqlClient.SqlException (0x80131904)
- Multiple file-extensions searchPattern for System.IO.Directory.GetFiles
- C# – Illegal characters in path
- Getting The ASCII Value of a character in a C# string
- Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host
- The remote server returned an error: (407) Proxy Authentication Required
- How to open a new form from another form
- C# – How to convert string to char?
- Nuget connection attempt failed “Unable to load the service index for source”
- Cannot access a disposed object – How to fix?
- HTML.ActionLink method
- Deep cloning objects
- Regular expression “^[a-zA-Z]” or “[^a-zA-Z]”
- Could not load file or assembly App_Web_ * with a precompiled ASP.NET website project
- .NET graph library around?
- An object reference is required to access a non-static member
- Task vs Thread differences
- Merging two arrays in .NET
- String was not recognized as a valid DateTime ” format dd/MM/yyyy”
- Connection string using Windows Authentication
- Checking if a string array contains a value, and if so, getting its position
- XmlSerializer – There was an error reflecting type
- What is The difference between ListBox and ListView
- Run Command Prompt Commands
- SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE()
- Could not establish secure channel for SSL/TLS with authority ‘*’
- Catch multiple exceptions at once?
- How to delete a file after checking whether it exists
- c# Show Windows Form
- How do I exit a WPF application programmatically?
- Entity Framework vs LINQ to SQL
- How to properly make a http web GET request
- How to create a new object instance from a Type
- Using FolderBrowserDialog in WPF application
- Is there an equivalent to the C# “var” keyword in C++/CLI?
- When should I use a List vs a LinkedList
- Could not find any resources appropriate for the specified culture or the neutral culture
- Playing a MP3 file in a WinForm application
- Iif equivalent in C#
- Convert an array to string
- LINQ query on a DataTable