I need some help with some code I made to replace the text of an item in a listView.
I want to replace all items under column 4 of my listView. Heres an example string of an item in column 4: <span class="stat">0.58
Anyways here is what I wrote to replace the text in my listView but it isn’t working:
foreach (ListViewItem i in listViewClickbank.Items)
{
if (i.SubItems[3].Text.Contains("span"))
{
i.Text.Replace("<span class=", "");
}
}
The
String.Replacemethod returns the new string. It doesn’t alter the original one. Also, you are changing theTextof the item (the first column), rather than the fourth column. Try this instead: