扫描二维码下载沐宇APP

沐宇

微信扫码使用沐宇小程序

沐宇

VB怎么向list里添加数据

扬州沐宇科技
2024-01-13 11:38:15
vb

在VB中,可以使用Add方法向List中添加数据。

以下是一个示例:

Dim myList As New List(Of String)

' 向List中添加数据
myList.Add("数据1")
myList.Add("数据2")
myList.Add("数据3")

' 输出List中的数据
For Each item As String In myList
    Console.WriteLine(item)
Next

这将向List中添加三个字符串数据,并通过循环输出每个数据项。

扫码添加客服微信