Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax for declaring optional string array parameter

What is the proper syntax for declaring an option parameter of type String(); means how do I assign it a default value of empty array (not Nothing):

Function SomeFunc(id as Integer, name as String, Optional values() As String = ???)

I tried with {} but it doesn't accept that, saying "A constant expression is required", which also means it won't accept anything like New String().

like image 549
dotNET Avatar asked Jun 03 '26 21:06

dotNET


1 Answers

hi You can Try This..

function example(optional ByVal arr1() as System.Array = nothing)
like image 166
user1102001 Avatar answered Jun 05 '26 16:06

user1102001



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!