Passing a constant array to a function in VB.NET

前端 未结 4 542
悲哀的现实
悲哀的现实 2021-01-18 11:30

I know that you can easily pass an array to a function, like the code below shows

Private Sub SomeFunction(ByVal PassedArray() As String)
    For i As Intege         


        
4条回答
  •  迷失自我
    2021-01-18 11:52

    The closest you can do is:

    SomeFunction(New String() {"some", "array", "members"})
    

    This is actually identical in terms of objects created to what you posted. There aren't actually array literals in .NET, just helpers for initialization.

提交回复
热议问题