for(int i=0; i<listBox1.Items.Count; i++) { value += listBox1.Items[i].ToString().Replace("=", "-")+"&"; }