「VB.NET」 For Each文でListの要素を取得する
サンプルコード
Module ModuleTest
Sub Main()
Dim ct As New List(Of String)
ct.Add("Aa01")
ct.Add("Bb02")
ct.Add("Cc03")
For Each t In ct
Console.WriteLine(t)
Next
End Sub
End Module
Module ModuleTest
Sub Main()
Dim ct As New List(Of String)
ct.Add("Aa01")
ct.Add("Bb02")
ct.Add("Cc03")
For Each t In ct
Console.WriteLine(t)
Next
End Sub
End Module
Module ModuleTest Sub Main() Dim ct As New List(Of String) ct.Add("Aa01") ct.Add("Bb02") ct.Add("Cc03") For Each t In ct Console.WriteLine(t) Next End Sub End Module
結果
Aa01 Bb02 Cc03