How to declare an array inline in VB.NET

后端 未结 6 1841
难免孤独
难免孤独 2021-02-04 23:30

I am looking for the VB.NET equivalent of

var strings = new string[] {\"abc\", \"def\", \"ghi\"};
6条回答
  •  忘掉有多难
    2021-02-04 23:56

    In newer versions of VB.NET that support type inferring, this shorter version also works:

    Dim strings = {"abc", "def", "ghi"}
    

提交回复
热议问题