Public Function Foo() as String()
Dim bar As String = {"bar1","bar2","bar3"}
Return bar
End Function
My situation is similar to the code sample above where I'm returning a string array from a function.
What I would like to do is just return the string array without having to declare a variable first and then return the variable.
Something like this, although this obviously doesn't work:
Return {"bar1","bar2","bar3"}
Is it possible to do this, I can't seem to find a method that works?
You could do this:
Public Function Foo() As String()
Return New String() {"bar1", "bar2", "bar3"}
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With