You need to escape them by doubling them (verbatim string literal):
string str = @"""How to add doublequotes""";
Or with a normal string literal you escape them with a \
:
string str = "\"How to add doublequotes\"";
More Related Contents:
- Annual calender in asp.net page [closed]
- How do I run this code
- How do I create a Dto in C# Asp.Net from a fairly complex Json Response
- The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider” could not be located
- How to get the groups of a user in Active Directory? (c#, asp.net)
- WebClient.DownloadString() returns string with peculiar characters
- How to fix “The ConnectionString property has not been initialized”
- Changing project port number in Visual Studio 2013
- Selectively use default JSON converter
- ASP.NET MVC – How to show unauthorized error on login page?
- HttpContext.Current.Session is null in Ashx file
- How to get current user who’s accessing an ASP.NET application?
- How to set web.config file to show full error message
- Calling a method in parent page from user control
- How to make Check Box List in ASP.Net MVC
- GridView bound with Properties of nested class
- Why is my ClaimsIdentity IsAuthenticated always false (for web api Authorize filter)?
- Date vs DateTime
- I’m getting the “missing a using directive or assembly reference” and no clue what’s going wrong
- How can I trigger/refresh my main .RAZOR page from all of its sub-components within that main .RAZOR page when an API call is complete?
- ASP.NET C# Static Variables are global?
- The model item passed into the dictionary is of type ‘mvc.Models.ModelA’ but this dictionary requires a model item of type ‘mvc.Models.ModelB‘
- How to use Property Injection with AutoFac?
- Value cannot be null. Parameter name: items (in Dropdown List) ASP.NET MVC5
- Filehandler in asp.net
- ASP .NET Button event handlers do not fire on the first click, but on the second click after a PostBack
- How to create Select List for Country and States/province in MVC
- Is there a way in Json.NET serialization to distinguish between “null because not present” and “null because null”?
- Block requests after multiple unsuccessful logins
- How do I get a directory size (files in the directory) in C#?