Passing a constant array to a function in VB.NET

前端 未结 4 546
悲哀的现实
悲哀的现实 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:48

    SomeFunction({"some", "array", "member"}) ' this obviously gives a syntax error
    

    This is a perfectly valid syntax starting with VB10 (Visual Studio 2010). See this:

    • New Features in Visual Basic 10, under Array Literals.

提交回复
热议问题