4,815 questions
var test3 = “(‘“ + string.Join(“‘ ,’”, test2) + “‘)”;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Let say, I have string array as following
string[] IncidentCategoryID;
Then, output as following,
How to program in C# to convert this string array into single string like this?
('1', '3', '2')
Make sure have
(
)
' ( single quote )
Please help
var test3 = “(‘“ + string.Join(“‘ ,’”, test2) + “‘)”;
Use system.string.join
string[] cars = { "Volvo", "BMW", "Ford", "Mazda" };
string carsTxt = string.Join("|", cars); // Return "Volvo|BMW|Ford|Mazda"
Hi @Bruce (SqlWork.com) ,
Your guide, I adjusted as following
var test3 = "('" + string.Join("', '", test2) + "')";
It's working
('1', '3', '2')