Hi, welcome to Microsoft Q&A.
You can use append method to add each string to values.
Check the following code.
string[] values = new string[] { };
var applicationSettings = ConfigurationManager.GetSection(ddlAppln.SelectedValue.ToString().Trim()) as NameValueCollection;
if (applicationSettings.Count == 0)
{
Console.WriteLine("Application Settings are not defined");
}
else
{
foreach (var key in applicationSettings.AllKeys)
{
foreach(string str in applicationSettings[key].ToString().Split(','))
{
values = values.Append<string>(str).ToArray();
}
}
}
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.