It is my first time here and I am struggling to solve this issue. I have this piece of code:
try
{
    progressBar1.Maximum = lista.Items.Count;
    lista.BeginUpdate();
    for (int i = 0; lista.Items.Count > i; i++)
    //for (int i = lista.Items.Count - 1; -1 < i; i--)
    {
        if (lista.Items[i].SubItems[1].Text.ToLower().Contains(Text) == false)
        {                        
            lista.Items[i].Remove();                        
        }
        progressBar1.Value = progressBar1.Value + 1;
    }
    lista.EndUpdate();
    progressBar1.Value = 0;
}
catch (Exception errore)
{
    txt_info.Text = "" + errore.Message;
    progressBar1.Value = 0;
}
The method lista.items[i].remove is extremely slow.
lista is a ListView and I am working on a log file bigger than 50,000 lines.
Is there anyway to speed up the process?
 
     
     
     
     
     
     
     
    