36 lines
561 B
Plaintext
36 lines
561 B
Plaintext
Array literals are more compact than array creation expressions.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,vbnet]
|
|
----
|
|
Module Module1
|
|
Sub Main()
|
|
Dim foo = New String() {"a", "b", "c"} ' Noncompliant
|
|
End Sub
|
|
End Module
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,vbnet]
|
|
----
|
|
Module Module1
|
|
Sub Main()
|
|
Dim foo = {"a", "b", "c"} ' Compliant
|
|
End Sub
|
|
End Module
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|