Advertisement
OedipusPrime

Untitled

Feb 19th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.24 KB | None | 0 0
  1. public static List<int> GetEvenNumbers(this List<int> nums)
  2. {
  3.     for (var i = nums.Count; i >= 0; i--)
  4.         {
  5.             if (i % 2 != 0)
  6.                 {
  7.                     nums.Remove(i);
  8.                 }
  9.     }
  10.  
  11.         return nums;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement