How to remove double quotes from string using C#?


I wanted to remove double quotes from a string using C#, How can I do that easily and efficiently?

For Example, I have string : "-10,20", how to get output -> -10,20

 


Asked by:- Vinnu
0
: 131 At:- 8/16/2019 12:35:50 PM
C# remove double quotes string






1 Answers
profileImage Answered by:- pika

Here are few ways to remove double quotes from string using C#

var yourString= "-10,20";
yourString = yourString.Replace('"', ' ').Trim();

OR

Using .Trim

yourString= yourString.Trim('"');

OR

yourString=yourString.Replace("\"", "");

Any of the above solutions should work.

1
At:- 8/21/2019 11:46:31 AM
Thanks for correct answer and all alternatives. 0
By : Vinnu - at :- 8/29/2019 3:05:42 PM





Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly