Skip to content

Instantly share code, notes, and snippets.

@kawakawa
Created September 11, 2012 13:29
Show Gist options
  • Save kawakawa/3698473 to your computer and use it in GitHub Desktop.
Save kawakawa/3698473 to your computer and use it in GitHub Desktop.
Dim Array() As Integer = {1, 10, 30, 40, 50, 70, 80, 90}
'50以上の値の数(for)
Dim Count As Integer
Dim I As Long
For I = 0 To Array.Length - 1
If Array(I) >= 50 Then
Count = Count + 1
End If
Next
Console.WriteLine(Count)
'50以上の値の数(LINQ)
Dim CountLinq = From n In Array Where n >= 50
Console.WriteLine(CountLinq.Count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment