Mega Code Archive

 
Categories / VB.Net / Data Structure
 

List(T) ForEach Method Performs the specified action on each element of the List(Of T)

Imports System Imports System.Collections.Generic Class Program     Shared Sub Main()         Dim names As New List(Of String)         names.Add("B")         names.Add("A")         names.Add("T")         names.Add("R")         names.ForEach(AddressOf Print)     End Sub     Shared Sub Print(ByVal s As String)         Console.WriteLine(s)     End Sub End Class