Strip double quotes from a string in C#
To remove double quotes from a string in C# we simply replace string usingReplace()
method and pass \"
as first parameter and empty string as second parameter.Example
using System;
public class Program
{
public static void Main()
{
string s = "\" hello";
Console.WriteLine(s);
s = s.Replace("\"", "");
Console.WriteLine(s);
}
}
Output
" hello
hello
hello