List(of String) or Array or ArrayList

后端 未结 7 2049
借酒劲吻你
借酒劲吻你 2021-01-01 10:27

Hopefully a simple question to most programmers with some experience.

What is the datatype that lets me do this?

Dim lstOfStrings as *IDK*

Dim Stri         


        
7条回答
  •  太阳男子
    2021-01-01 10:54

    Sometimes I don't want to add items to a list when I instantiate it.

    Instantiate a blank list

    Dim blankList As List(Of String) = New List(Of String)
    

    Add to the list

    blankList.Add("Dis be part of me list") 'blankList is no longer blank, but you get the drift
    

    Loop through the list

    For Each item in blankList
      ' write code here, for example:
      Console.WriteLine(item)
    Next
    

提交回复
热议问题