In the below code i have a string array which holds values like "1,2,3" i want to remove the double quotes and display as 1,2,3.pls help me to do this.
string[] Stocks = StockDetails.ToArray();
string s = string.Join(",", Stocks);
In the below code i have a string array which holds values like "1,2,3" i want to remove the double quotes and display as 1,2,3.pls help me to do this.
string[] Stocks = StockDetails.ToArray();
string s = string.Join(",", Stocks);
If you're having string in this format
string str = "\"1,2,3\"";
..then you can simply remove the double quotation marks using Replace method on string.
str = str.Replace("\"", "");
..this will replace the double quotation from your string, and will return the simple text that is not a double quotes.
More I don't think strings are like this, you're having a look at the actual value of the variable string you're having. When you will use it, it will give you the actual 1, 2, 3
but however, use the above code to remove the quotation .
You can just use string.Replace
var listOfStrings = StockDetails.Select(s => s.Replace("\"", string.Empty))
.ToList();