vb System.Array.ForEach<T>类(方法)实例源码

下面列出了vb System.Array.ForEach<T> 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:Syste   
Public Class SamplesArray
    Public Shared Sub Main()
        ' create a three element array of integers
        Dim intArray() As Integer = New Integer() {2, 3, 4}

        ' set a delegate for the ShowSquares method
        Dim action As New Action(Of Integer)(AddressOf ShowSquares)

        Array.ForEach(intArray, action)
    End Sub

    Private Shared Sub ShowSquares(val As Integer)
        Console.WriteLine("{0:d} squared = {1:d}", val, val*val)
    End Sub
End Class


问题


面经


文章

微信
公众号

扫码关注公众号