Hello. If I have an array of integers, how can return a list of all the elements that are a certain number? For example, say elements 4, 5, 12, 23 of Array A (which has 30 elements in total) have a value of 5. How can I store all of those numbers in integers array “List”(so element 0 of array list would be 4, element 1 would 5, and so on)? Thanks
var targetList = new List();
for (var i = 0; i < sourceList.Length; i++)
{
if (sourceList *== targetNumber) targetList.Add(i);*
}
The above is in c#