Created
January 21, 2013 20:49
-
-
Save ghoti143/4589219 to your computer and use it in GitHub Desktop.
list foreach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using JSIL; | |
using JSIL.Meta; | |
using System.Collections.Generic; | |
public static class Program { | |
public static void Main () { | |
var list = new List<long?>() { 1, 0, 3, null }; | |
for (int i = 0; i < list.Count; i++) | |
{ | |
if (list[i].HasValue && list[i].Value == 0) | |
{ | |
list[i] = null; | |
} | |
} | |
foreach(var item in list) | |
{ | |
Console.WriteLine(item); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment