Search and Replace listbox with text


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. for (int i = 0; i < listBox1.Items.Count; i++)
  2. {
  3. String Text = Convert.ToString(listBox1.Items[i]);
  4. Text = Text.Replace(textBox2.Text, textBox3.Text);
  5. listBox1.Items[i] = Text;
  6.  
  7. // listBox1.Items[i] = Regex.Replace(Convert.ToString(listBox1.Items[i]), textBox2.Text, textBox3.Text);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.