Hi all
I was into filtering items lately
and I have decided to write about some of the techniques out there starting with the old
Well we have all used this before once you get a list in your hands just iterate through all the items and select the ones you want:
1: private static List<int> TheOld_FilterPositiveItems(List<int> t)
2: {
3: List<int> ret = new List<int>();
4: foreach (int i in t)
5: {
6: if (i > 0)
7: {
8: ret.Add(i);
9: }
10: }
11: return ret;
12: }
I hope you are not using this method. As there are other good methods like this one:
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More