

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does the @ prefix do on string literals in C#?
The @prefix states hat you don't need to escape special characters in the string following to the symbol.
The following statement
@"D:\new"
is equal to:
"D:\\new"
The @ prefix is also used if you want to have large strings and want it to be displayed across multiple lines. The following is an example showing multi-line string −
Example
using System; namespace Demo { class Program { static void Main(string[] args) { string str = @"Welcome User, Kindly wait for the image to load"; Console.WriteLine(str); } } }
Output
Welcome User, Kindly wait for the image to load
- Related Questions & Answers
- What does the '@' prefix do in PHP?
- What does double underscore prefix do in Python variables?
- What is the difference between character literals and string literals in Java?
- What are Perl String Literals?
- What are string literals in C#?
- How and where does String literals in Java stored in the memory?
- What are string literals in C language?
- What is the type of string literals in C/ C++?
- What does opening a file actually do on Linux?
- What does the method toArray() do?
- What does the pandas.series.array attribute do?
- What does the pandas.series.index attribute do?
- What does the pandas.series.values attribute do?
- What does the compareTo do in Java?
- Formatted string literals in C#
Advertisements