Replace string in C#

Replace string in C#

How to Replace " (double quotes) in C# Sharp string? | Remove " (double quotes) in C# string? | Strip Double Quotes from String | Replace double quotes in c# string | Replace double quotes in c sharp string

I have a string in C Sharp whose content when displayed looks like below

            This is my text with some double "quotes"  

My objective is to Remove the double quotes in C# string and replace them with empty string. 

This can be achieve using below 2 ways

Example 1

C# code

string myStringWithQuotes = @"This is my text with some double ""quotes""";

Response.Write( myStringWithQuotes.Replace(@"""", string.Empty) );


Example 2
C# code 

string myStringWithQuotes = @"This is my text with some double ""quotes""";

Response.Write( myStringWithQuotes.Replace("\"", string.Empty) );


Output in both cases -->   This is my text with some double quotes  

 So hope this helps you all. Happy Coding :)

C# DateTime ToString()[C#] Remove Last Character From StringC# foreach loopc# stringHow To Declare and access array of string in C#Split String In String vs Convert String To ImageC# Binary To StringC# Convert String To DateTimeConvert Array To Comma Separated String C#


My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.

I'm Satalaj.