
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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
- Related Articles
- 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 string literals in C#?
- How and where does String literals in Java stored in the memory?
- What are Perl String Literals?
- What are string literals in C language?
- What is the type of string literals in C/ C++?
- What Does cd do on Linux
- Formatted string literals in C#
- What is the type of string literals in C and C++?
- What happen if we concatenate two string literals in C++?
- Formatted string literals (f-strings) in Python?
- Character constants vs String literals in C#
- What does opening a file actually do on Linux?

Advertisements