No.
Either use verbatim string literals as you have, or escape the "
using backslash.
string test = "He said to me, \"Hello World\" . How are you?";
The string has not changed in either case – there is a single escaped "
in it. This is just a way to tell C# that the character is part of the string and not a string terminator.
Related Posts:
- How can I convert String to Int?
- Convert int to string?
- Converting string to byte array in C#
- How can I add ” character to a multi line string declaration in C#?
- C# List
to string with delimiter - Convert a list of strings to a single string
- C#: how to get first char of a string?
- How to initialize a list of strings (List
) with many string values - What does {0} mean when found in a string in C#?
- C# – Illegal characters in path
- Getting The ASCII Value of a character in a C# string
- How can I fix the error : “Unreachable Code Detected”
- C# – How to convert string to char?
- Creating a comma separated list from IList
or IEnumerable - Fastest way to remove first char in a String
- Checking if a string array contains a value, and if so, getting its position
- Substring index and length must refer to a location within the string
- Case insensitive ‘Contains(string)’
- Most efficient way to remove special characters from string
- Is there an equivalent to the Scanner class in C# for strings?
- Adding a newline into a string in C#
- How to format a string as a telephone number in C#
- How to convert UTF-8 byte[] to string
- .NET String.Format() to add commas in thousands place for a number
- How would you count occurrences of a string (actually a char) within a string?
- C# equivalent to Java’s charAt()?
- What is a quick way to force CRLF in C# / .NET?
- Check if a string is a palindrome
- Convert string to decimal, keeping fractions
- Convert JSON String to JSON Object c#
- Convert an array to string
- Unrecognized escape sequence for path string containing backslashes
- Convert HTML to PDF in .NET
- C# HttpClient An existing connection was forcibly closed by the remote host
- IOException: The process cannot access the file ‘file path’ because it is being used by another process
- Error : Index was outside the bounds of the array.
- No connection could be made because the target machine actively refused it?
- What does a lock statement do under the hood?
- What is C# equivalent of
- What are the benefits to marking a field as `readonly` in C#?
- ASP.NET 5 MVC: unable to connect to web server ‘IIS Express’
- Why is this code throwing an InvalidOperationException?
- How to add a default Default.aspx to a ASP.NET Web Application Project?
- Regex for numbers only
- C# equivalent of C++ vector, with contiguous memory?
- Access to the path is denied
- What does question mark and dot operator ?. mean in C# 6.0?
- How to jump in Unity 3d?
- ToList().ForEach in Linq
- Proper way to initialize a C# dictionary with values
- Get dictionary value by key
- Invalid URI: The format of the URI could not be determined
- Unity “The associated script can not be loaded” and “Win32Exception: The system cannot find the file specified”
- Convert Linq Query Result to Dictionary
- Get single value from dictionary by key
- What is the difference between “@Scripts.Render” and “
Recommended Hostings
Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.
FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.