28
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VB.NET List(Of T) 宣言と同時に初期化

Last updated at Posted at 2014-03-16

配列の宣言同時初期化のサンプルはネットでよく見かけるけれど、List(Of T) の初期化についてあまり見かけないのと、直ぐに忘れてしまうので備忘録として。

抜粋
Dim fruitList As New List(Of String)(New String() {"apple", "banana", "citrus"})

For Each fruit As String In fruitList
    Console.WriteLine(fruit)
Next

もちろん String の部分は別のオブジェクトでも可能。

28
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?