i have a string like One,Two ,three
I want a string like '"One","Two","Three"'
Hi Vasanth057,
Refer below code.
string a = "'\"" + "One,Two,three".Replace(",", "\",\"") + "\"'";
Itz working But When we pass that values stored Procedure parameter the value like "\American"
Please explain with complete details.
string[] CusineType; ArrayList cblSelections = new ArrayList(); foreach (ListItem item in chkCuisieType.Items) { if (item.Selected) { cblSelections.Add(item.Text); } } CusineType = (string[])cblSelections.ToArray(typeof(string)); string CusineValue = string.Join(",", CusineType);
How to add that Single Quotes to the Cusinevalue
After getting the value you can replace like as i have already provided.
string CusineValue = string.Join(",", CusineType); CusineValue = "'\"" + CusineValue.Replace(",", "\",\"") + "\"'";
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.