|
CommonCreateArrayT(Int32) Method
|
Creates a strongly-typed Array.
Namespace: GSFAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.230-beta+03417d7b5cff037b24e882d7adef82d359b34964
Syntaxpublic static T[] CreateArray<T>(
int length
)
Public Shared Function CreateArray(Of T) (
length As Integer
) As T()
public:
generic<typename T>
static array<T>^ CreateArray(
int length
)
static member CreateArray :
length : int -> 'T[]
JavaScript does not support generic types or methods.
View SourceParameters
- length Int32
- Desired length of new array.
Type Parameters
- T
- Return type for new array.
Return Value
TNew array of specified type.
RemarksIt is expected that this function will only be used in Visual Basic.NET.
The Array.CreateInstance provides better performance and more direct CLR access for array creation (not to
mention less confusion on the matter of array lengths) in VB.NET, however the returned System.Array is not
typed properly. This function properly casts the return array based on the type specification helping
when Option Strict is enabled.
ExampleDim buffer As Byte() = CreateArray(Of Byte)(12)
Dim matrix As Integer()() = CreateArray(Of Integer())(10)
See Also