- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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:
ew"
is equal to:
"D:\
ew"
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
Advertisements