I have listbox and its selected value display in text box like 1,2,3,Part1, Part3, etc. using below code.
But issue is comma is appear after last selected value. i want to remove it comma should be display between two value not prefix or suffix.
How to remove it in c# web application.
txtaprtment.Text = "";
for (int i = 0; i < chkblockselection.Items.Count; i++)
{
if (chkblockselection.Items[i].Selected)
{
txtaprtment.Text += chkblockselection.Items[i].Text + "," ;
}
}