Module Module1
'にゃんこクラス
Public Class Cat
Private _name As String
Property Name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Private _type As String
Property Type() As String
Get
Return _Type
End Get
Set(ByVal value As String)
_Type = value
End Set
End Property
End Class
Sub Main()
Dim Nyans As New List(Of Cat)
'にゃんこが集合
Nyans.Add(New Cat With {.Name = "しゅうたん", .Type = "アメショ"})
Nyans.Add(New Cat With {.Name = "ろり", .Type = "アメショ"})
Nyans.Add(New Cat With {.Name = "みずきちゃん", .Type = "スコティ"})
Nyans.Add(New Cat With {.Name = "マグさん", .Type = "ほげ"})
'怪しい「ほげ」猫さんは除外
Nyans = (From x In Nyans Where x.Type IsNot "ほげ").ToList
For Each nyan In Nyans
Console.WriteLine("{0}は{1}", nyan.Name, nyan.Type)
Next
Stop
End Sub
End Module