I have a list of items, say 100 items. I need to add another element in front of an existing element that matches my state. What is the fastest way and maximum performance optimized for this? i.e:.
foreach (var i in myList) { if (myList[i].value == "myValue") { myList[i-1] add ("someOtherValue") } }
Maybe I should use a different container?
source share