Currently I am using this to create a string array
New String() {" ", ".", ";"}
Is there another way that does not require so many characters, say without the New String() part perhaps?
Currently I am using this to create a string array
New String() {" ", ".", ";"}
Is there another way that does not require so many characters, say without the New String() part perhaps?
The compiler can usually infer the type of the array from its elements, e.g.
Dim stringArray = {" ", ".", ";"}
Note - this doesn't work when the array is empty, because there are no elements to examine.
Dim stringArray = New String() {} ' specify the source type, infer the destination type
Dim stringArray As String() = {} ' specify the destination type, infer the source type
Dim stringArray As New String() would be shorter without Infer being on.Dim stringArray = " . ".Cast(Of String)().ToArray()