Array 클래스

정의

배열을 만들고, 조작하고, 검색 및 정렬하여 공용 언어 런타임에서 모든 배열의 기본 클래스 역할을 수행하도록 하는 메서드를 제공합니다.

public ref class Array abstract : System::Collections::IList, System::Collections::IStructuralComparable, System::Collections::IStructuralEquatable
public ref class Array abstract : ICloneable, System::Collections::IList, System::Collections::IStructuralComparable, System::Collections::IStructuralEquatable
public ref class Array abstract : ICloneable, System::Collections::IList
public abstract class Array : System.Collections.IList, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
public abstract class Array : ICloneable, System.Collections.IList, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
[System.Serializable]
public abstract class Array : ICloneable, System.Collections.IList
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Array : ICloneable, System.Collections.IList
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Array : ICloneable, System.Collections.IList, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
type Array = class
    interface ICollection
    interface IEnumerable
    interface IList
    interface IStructuralComparable
    interface IStructuralEquatable
type Array = class
    interface ICollection
    interface IEnumerable
    interface IList
    interface IStructuralComparable
    interface IStructuralEquatable
    interface ICloneable
[<System.Serializable>]
type Array = class
    interface ICloneable
    interface IList
    interface ICollection
    interface IEnumerable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Array = class
    interface ICloneable
    interface IList
    interface ICollection
    interface IEnumerable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Array = class
    interface ICloneable
    interface IList
    interface ICollection
    interface IEnumerable
    interface IStructuralComparable
    interface IStructuralEquatable
type Array = class
    interface IList
    interface ICollection
    interface IEnumerable
    interface IStructuralComparable
    interface IStructuralEquatable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Array = class
    interface ICloneable
    interface ICollection
    interface IList
    interface IEnumerable
    interface IStructuralComparable
    interface IStructuralEquatable
Public MustInherit Class Array
Implements IList, IStructuralComparable, IStructuralEquatable
Public MustInherit Class Array
Implements ICloneable, IList, IStructuralComparable, IStructuralEquatable
Public MustInherit Class Array
Implements ICloneable, IList
상속
Array
특성
구현

예제

다음 코드 예제에서는 형식 정수 배열과 형식 배열 간에 요소를 복사하는 Object방법을 Array.Copy 보여 줍니다.

using namespace System;

void PrintValues(array<Object^>^myArr);
void PrintValues(array<int>^myArr);
void main()
{
    // Creates and initializes a new int array and a new Object array.
    array<int>^myIntArray = { 1,2,3,4,5 };
    array<Object^>^myObjArray = { 26,27,28,29,30 };

    // Prints the initial values of both arrays.
    Console::WriteLine("Initially:");
    Console::Write("int array:   ");
    PrintValues(myIntArray);
    Console::Write("Object array:");
    PrintValues(myObjArray);

    // Copies the first two elements from the int array to the Object array.
    System::Array::Copy(myIntArray, myObjArray, 2);

    // Prints the values of the modified arrays.
    Console::WriteLine("\nAfter copying the first two elements of the int array to the Object array:");
    Console::Write("int array:   ");
    PrintValues(myIntArray);
    Console::Write("Object array:");
    PrintValues(myObjArray);

    // Copies the last two elements from the Object array to the int array.
    System::Array::Copy(myObjArray, myObjArray->GetUpperBound(0) - 1, myIntArray, myIntArray->GetUpperBound(0) - 1, 2);

    // Prints the values of the modified arrays.
    Console::WriteLine("\nAfter copying the last two elements of the Object array to the int array:");
    Console::Write("int array:   ");
    PrintValues(myIntArray);
    Console::Write("Object array:");
    PrintValues(myObjArray);
}

void PrintValues(array<Object^>^myArr)
{
    for (int i = 0; i < myArr->Length; i++)
    {
        Console::Write("\t{0}", myArr[i]);

    }
    Console::WriteLine();
}

void PrintValues(array<int>^myArr)
{
    for (int i = 0; i < myArr->Length; i++)
    {
        Console::Write("\t{0}", myArr[i]);

    }
    Console::WriteLine();
}


/*
This code produces the following output.

Initially:
int array:       1    2    3    4    5
Object array:    26    27    28    29    30
After copying the first two elements of the int array to the Object array:
int array:       1    2    3    4    5
Object array:    1    2    28    29    30
After copying the last two elements of the Object array to the int array:
int array:       1    2    3    29    30
Object array:    1    2    28    29    30
*/
open System

let printValues myArr =
    for i in myArr do
        printf $"\t{i}"
    printfn ""

// Creates and initializes a new integer array and a new Object array.
let myIntArray = [| 1..5 |]
let myObjArray = [| 26..30 |]

// Prints the initial values of both arrays.
printfn "Initially,"
printf "integer array:"
printValues myIntArray
printfn "Object array: "
printValues myObjArray

// Copies the first two elements from the integer array to the Object array.
Array.Copy(myIntArray, myObjArray, 2)

// Prints the values of the modified arrays.
printfn "\nAfter copying the first two elements of the integer array to the Object array,"
printf "integer array:"
printValues myIntArray
printf"Object array: "
printValues myObjArray

// Copies the last two elements from the Object array to the integer array.
Array.Copy(myObjArray, myObjArray.GetUpperBound 0 - 1, myIntArray, myIntArray.GetUpperBound 0 - 1, 2)

// Prints the values of the modified arrays.
printfn $"\nAfter copying the last two elements of the Object array to the integer array,"
printf "integer array:"
printValues myIntArray
printf "Object array: "
printValues myObjArray


// This code produces the following output.
//     Initially,
//     integer array:  1       2       3       4       5
//     Object array:   26      27      28      29      30
//     
//     After copying the first two elements of the integer array to the Object array,
//     integer array:  1       2       3       4       5
//     Object array:   1       2       28      29      30
//     
//     After copying the last two elements of the Object array to the integer array,
//     integer array:  1       2       3       29      30
//     Object array:   1       2       28      29      30
using System;
public class SamplesArray
{

    public static void Main()
    {

        // Creates and initializes a new integer array and a new Object array.
        int[] myIntArray = new int[5] { 1, 2, 3, 4, 5 };
        Object[] myObjArray = new Object[5] { 26, 27, 28, 29, 30 };

        // Prints the initial values of both arrays.
        Console.WriteLine("Initially,");
        Console.Write("integer array:");
        PrintValues(myIntArray);
        Console.Write("Object array: ");
        PrintValues(myObjArray);

        // Copies the first two elements from the integer array to the Object array.
        System.Array.Copy(myIntArray, myObjArray, 2);

        // Prints the values of the modified arrays.
        Console.WriteLine("\nAfter copying the first two elements of the integer array to the Object array,");
        Console.Write("integer array:");
        PrintValues(myIntArray);
        Console.Write("Object array: ");
        PrintValues(myObjArray);

        // Copies the last two elements from the Object array to the integer array.
        System.Array.Copy(myObjArray, myObjArray.GetUpperBound(0) - 1, myIntArray, myIntArray.GetUpperBound(0) - 1, 2);

        // Prints the values of the modified arrays.
        Console.WriteLine("\nAfter copying the last two elements of the Object array to the integer array,");
        Console.Write("integer array:");
        PrintValues(myIntArray);
        Console.Write("Object array: ");
        PrintValues(myObjArray);
    }

    public static void PrintValues(Object[] myArr)
    {
        foreach (Object i in myArr)
        {
            Console.Write("\t{0}", i);
        }
        Console.WriteLine();
    }

    public static void PrintValues(int[] myArr)
    {
        foreach (int i in myArr)
        {
            Console.Write("\t{0}", i);
        }
        Console.WriteLine();
    }
}
/*
This code produces the following output.

Initially,
integer array:  1       2       3       4       5
Object array:   26      27      28      29      30

After copying the first two elements of the integer array to the Object array,
integer array:  1       2       3       4       5
Object array:   1       2       28      29      30

After copying the last two elements of the Object array to the integer array,
integer array:  1       2       3       29      30
Object array:   1       2       28      29      30
*/
Public Class SamplesArray

    Public Shared Sub Main()

        ' Creates and initializes a new integer array and a new Object array.
        Dim myIntArray() As Integer = {1, 2, 3, 4, 5}
        Dim myObjArray() As Object = {26, 27, 28, 29, 30}

        ' Prints the initial values of both arrays.
        Console.WriteLine("Initially:")
        Console.Write("integer array:")
        PrintValues(myIntArray)
        Console.Write("Object array: ")
        PrintValues(myObjArray)

        ' Copies the first two elements from the integer array to the Object array.
        System.Array.Copy(myIntArray, myObjArray, 2)

        ' Prints the values of the modified arrays.
        Console.WriteLine(ControlChars.NewLine + "After copying the first two" _
           + " elements of the integer array to the Object array:")
        Console.Write("integer array:")
        PrintValues(myIntArray)
        Console.Write("Object array: ")
        PrintValues(myObjArray)

        ' Copies the last two elements from the Object array to the integer array.
        System.Array.Copy(myObjArray, myObjArray.GetUpperBound(0) - 1, myIntArray,
           myIntArray.GetUpperBound(0) - 1, 2)

        ' Prints the values of the modified arrays.
        Console.WriteLine(ControlChars.NewLine + "After copying the last two" _
           + " elements of the Object array to the integer array:")
        Console.Write("integer array:")
        PrintValues(myIntArray)
        Console.Write("Object array: ")
        PrintValues(myObjArray)
    End Sub

    Public Overloads Shared Sub PrintValues(myArr() As Object)
        Dim i As Object
        For Each i In myArr
            Console.Write(ControlChars.Tab + "{0}", i)
        Next i
        Console.WriteLine()
    End Sub

    Public Overloads Shared Sub PrintValues(myArr() As Integer)
        Dim i As Integer
        For Each i In myArr
            Console.Write(ControlChars.Tab + "{0}", i)
        Next i
        Console.WriteLine()
    End Sub
End Class

' This code produces the following output.
' 
' Initially:
' integer array:  1       2       3       4       5
' Object array:   26      27      28      29      30
' 
' After copying the first two elements of the integer array to the Object array:
' integer array:  1       2       3       4       5
' Object array:   1       2       28      29      30
' 
' After copying the last two elements of the Object array to the integer array:
' integer array:  1       2       3       29      30
' Object array:   1       2       28      29      30

다음 코드 예제에서는 속성 및 해당 요소를 만들고 초기화 Array 하고 표시합니다.

using namespace System;
void PrintValues(Array^ myArr);
void main()
{
   // Creates and initializes a new three-dimensional Array instance of type Int32.
   Array^ myArr = Array::CreateInstance( Int32::typeid, 2, 3, 4 );
   for ( int i = myArr->GetLowerBound( 0 ); i <= myArr->GetUpperBound( 0 ); i++ )
   {
      for ( int j = myArr->GetLowerBound( 1 ); j <= myArr->GetUpperBound( 1 ); j++ )
      {
         for ( int k = myArr->GetLowerBound( 2 ); k <= myArr->GetUpperBound( 2 ); k++ )
            myArr->SetValue( (i * 100) + (j * 10) + k, i, j, k );

      }
   }
   
   // Displays the properties of the Array.
   Console::WriteLine(  "The Array instance has {0} dimension(s) and a total of {1} elements.", myArr->Rank, myArr->Length );
   Console::WriteLine(  "\tLength\tLower\tUpper" );
   for ( int i = 0; i < myArr->Rank; i++ )
   {
      Console::Write(  "{0}:\t{1}", i, myArr->GetLength( i ) );
      Console::WriteLine(  "\t{0}\t{1}", myArr->GetLowerBound( i ), myArr->GetUpperBound( i ) );

   }
   Console::WriteLine(  "The Array instance contains the following values:" );
   PrintValues( myArr );
}

void PrintValues( Array^ myArr )
{
   System::Collections::IEnumerator^ myEnumerator = myArr->GetEnumerator();
   int i = 0;
   int cols = myArr->GetLength( myArr->Rank - 1 );
   while ( myEnumerator->MoveNext() )
   {
      if ( i < cols )
            i++;
      else
      {
         Console::WriteLine();
         i = 1;
      }

      Console::Write(  "\t{0}", myEnumerator->Current );
   }

   Console::WriteLine();
}

/* 
 This code produces the following output.
 
 The Array instance has 3 dimension(s) and a total of 24 elements.
     Length    Lower    Upper
 0:    2    0    1
 1:    3    0    2
 2:    4    0    3
 The Array instance contains the following values:
     0    1    2    3
     10    11    12    13
     20    21    22    23
     100    101    102    103
     110    111    112    113
     120    121    122    123
 */
open System

let printValues (myArray: Array) =
    let mutable i = 0
    let cols = myArray.GetLength(myArray.Rank - 1)
    for item in myArray do
        if i < cols then
            i <- i + 1
        else
            printfn ""
            i <- 1;
        printf $"\t{item}"
    printfn ""

// Creates and initializes a new three-dimensional Array of type int.
let myArr = Array.CreateInstance(typeof<int>, 2, 3, 4)
for i = myArr.GetLowerBound 0 to myArr.GetUpperBound 0 do
    for j = myArr.GetLowerBound 1 to myArr.GetUpperBound 1 do
        for k = myArr.GetLowerBound 2 to myArr.GetUpperBound 2 do
            myArr.SetValue(i * 100 + j * 10 + k, i, j, k)

// Displays the properties of the Array.
printfn $"The Array has {myArr.Rank} dimension(s) and a total of {myArr.Length} elements."
printfn $"\tLength\tLower\tUpper"

for i = 0 to myArr.Rank - 1 do
    printf $"{i}:\t{myArr.GetLength i}"
    printfn $"\t{myArr.GetLowerBound i}\t{myArr.GetUpperBound i}"

// Displays the contents of the Array.
printfn "The Array contains the following values:"
printValues myArr

// This code produces the following output.
// The Array has 3 dimension(s) and a total of 24 elements.
//     Length    Lower    Upper
// 0:  2    0    1
// 1:  3    0    2
// 2:  4    0    3
//
// The Array contains the following values:
//    0      1      2      3
//    10     11     12     13
//    20     21     22     23
//    100    101    102    103
//    110    111    112    113
//    120    121    122    123
// Creates and initializes a new three-dimensional Array of type int.
Array myArr = Array.CreateInstance(typeof(int), 2, 3, 4);
for (int i = myArr.GetLowerBound(0); i <= myArr.GetUpperBound(0); i++)
{
    for (int j = myArr.GetLowerBound(1); j <= myArr.GetUpperBound(1); j++)
    {
        for (int k = myArr.GetLowerBound(2); k <= myArr.GetUpperBound(2); k++)
        {
            myArr.SetValue((i * 100) + (j * 10) + k, i, j, k);
        }
    }
}

// Displays the properties of the Array.
Console.WriteLine("The Array has {0} dimension(s) and a total of {1} elements.", myArr.Rank, myArr.Length);
Console.WriteLine("\tLength\tLower\tUpper");
for (int i = 0; i < myArr.Rank; i++)
{
    Console.Write("{0}:\t{1}", i, myArr.GetLength(i));
    Console.WriteLine("\t{0}\t{1}", myArr.GetLowerBound(i), myArr.GetUpperBound(i));
}

// Displays the contents of the Array.
Console.WriteLine("The Array contains the following values:");
PrintValues(myArr);

void PrintValues(Array myArray)
{
    System.Collections.IEnumerator myEnumerator = myArray.GetEnumerator();
    int i = 0;
    int cols = myArray.GetLength(myArray.Rank - 1);
    while (myEnumerator.MoveNext())
    {
        if (i < cols)
        {
            i++;
        }
        else
        {
            Console.WriteLine();
            i = 1;
        }
        Console.Write("\t{0}", myEnumerator.Current);
    }
    Console.WriteLine();
}
// This code produces the following output.

// The Array has 3 dimension(s) and a total of 24 elements.
//     Length    Lower    Upper
// 0:  2    0    1
// 1:  3    0    2
// 2:  4    0    3
//
// The Array contains the following values:
//    0      1      2      3
//    10     11     12     13
//    20     21     22     23
//    100    101    102    103
//    110    111    112    113
//    120    121    122    123
Public Class SamplesArray2

    Public Shared Sub Main()

        ' Creates and initializes a new three-dimensional Array of
        ' type Int32.
        Dim myArr As Array = Array.CreateInstance(GetType(Int32), 2, 3, 4)
        Dim i As Integer
        For i = myArr.GetLowerBound(0) To myArr.GetUpperBound(0)
            Dim j As Integer
            For j = myArr.GetLowerBound(1) To myArr.GetUpperBound(1)
                Dim k As Integer
                For k = myArr.GetLowerBound(2) To myArr.GetUpperBound(2)
                    myArr.SetValue(i * 100 + j * 10 + k, i, j, k)
                Next k
            Next j
        Next i ' Displays the properties of the Array.
        Console.WriteLine("The Array has {0} dimension(s) and a " _
           + "total of {1} elements.", myArr.Rank, myArr.Length)
        Console.WriteLine(ControlChars.Tab + "Length" + ControlChars.Tab _
           + "Lower" + ControlChars.Tab + "Upper")
        For i = 0 To myArr.Rank - 1
            Console.Write("{0}:" + ControlChars.Tab + "{1}", i,
               myArr.GetLength(i))
            Console.WriteLine(ControlChars.Tab + "{0}" + ControlChars.Tab _
               + "{1}", myArr.GetLowerBound(i), myArr.GetUpperBound(i))
        Next i

        ' Displays the contents of the Array.
        Console.WriteLine("The Array contains the following values:")
        PrintValues(myArr)
    End Sub

    Public Shared Sub PrintValues(myArr As Array)
        Dim myEnumerator As System.Collections.IEnumerator =
           myArr.GetEnumerator()
        Dim i As Integer = 0
        Dim cols As Integer = myArr.GetLength(myArr.Rank - 1)
        While myEnumerator.MoveNext()
            If i < cols Then
                i += 1
            Else
                Console.WriteLine()
                i = 1
            End If
            Console.Write(ControlChars.Tab + "{0}", myEnumerator.Current)
        End While
        Console.WriteLine()
    End Sub
End Class

' This code produces the following output.
' 
' The Array has 3 dimension(s) and a total of 24 elements.
'     Length    Lower    Upper
' 0:    2    0    1
' 1:    3    0    2
' 2:    4    0    3
' The Array contains the following values:
'     0    1    2    3
'     10    11    12    13
'     20    21    22    23
'     100    101    102    103
'     110    111    112    113
'     120    121    122    123

설명

클래스가 Array 네임스페이 System.Collections 스의 일부가 아닙니다. 그러나 인터페이스를 기반으로 IList 하므로 여전히 컬렉션으로 간주됩니다.

Array 클래스는 배열을 지원하는 언어 구현의 기본 클래스입니다. 그러나 시스템 및 컴파일러만 클래스에서 Array 명시적으로 파생할 수 있습니다. 사용자는 언어에서 제공하는 배열 구문을 사용해야 합니다.

요소는 .의 값입니다 Array. 길이는 포함할 Array 수 있는 요소의 총 수입니다. 하한 Array 은 첫 번째 요소의 인덱스입니다. 하 Array 한은 있을 수 있지만 기본적으로 하한은 0입니다. 를 사용하여 CreateInstance클래스의 인스턴스를 만들 때 다른 하한을 Array 정의할 수 있습니다. 다차원은 Array 각 차원에 대해 서로 다른 범위를 가질 수 있습니다. 배열은 최대 32개의 차원을 가질 수 있습니다.

네임스페이스의 클래스와 System.Collections Array 달리 고정된 용량이 있습니다. 용량을 늘리려면 필요한 용량을 사용하여 새 Array 개체를 만들고, 이전 Array 개체의 요소를 새 개체로 복사하고, 이전 Array개체를 삭제해야 합니다.

배열 크기는 총 40억 개의 요소로 제한되며 지정된 차원의 최대 0X7FEFFFFF 인덱스로 제한됩니다(바이트 배열 및 싱글 바이트 구조의 배열에 대한 0X7FFFFFC7).

.NET Framework 전용: 기본적으로 최대 크기 Array 는 2GB입니다. 64비트 환경에서는 gcAllowVeryLargeObjects 구성 요소의 특성을 런타임 환경에서 설정 enabled 하여 크기 제한을 방지할 true 수 있습니다.

1차원 배열은 , System.Collections.Generic.ICollection<T>System.Collections.Generic.IEnumerable<T>System.Collections.Generic.IReadOnlyList<T> System.Collections.Generic.IReadOnlyCollection<T> 제네릭 인터페이스를 구현System.Collections.Generic.IList<T>합니다. 구현은 런타임에 배열에 제공되며, 따라서 제네릭 인터페이스는 클래스의 선언 구문에 Array 표시되지 않습니다. 또한 배열을 제네릭 인터페이스 형식(명시적 인터페이스 구현)으로 캐스팅해야만 액세스할 수 있는 인터페이스 멤버에 대한 참조 항목이 없습니다. 이러한 인터페이스 중 하나로 배열을 캐스팅할 때 알아야 할 중요한 사항은 요소를 추가, 삽입 또는 제거하는 멤버가 throw NotSupportedException된다는 것입니다.

Type 개체는 배열 형식 선언에 대한 정보를 제공합니다. Array 배열 형식이 동일한 개체는 동일한 Type 개체를 공유합니다.

Type.IsArrayType.GetElementType 배열이 형식Array으로 Array 캐스팅되는 경우 결과는 배열이 아닌 개체이므로 예상 결과를 반환하지 않을 수 있습니다. 즉, typeof(System.Array).IsArray 반환 false하고 typeof(System.Array).GetElementType 반환합니다 null.

메서드는 Array.Copy 동일한 형식의 배열 간뿐만 아니라 다양한 형식의 표준 배열 간에 요소를 복사합니다. 형식 캐스팅을 자동으로 처리합니다.

CreateInstanceGetValueCopyCopyToSetValue64비트 정수를 대용량 배열을 수용하기 위한 매개 변수로 수락하는 오버로드를 제공하는 메서드도 있습니다. LongLength 배열 GetLongLength 의 길이를 나타내는 64비트 정수와 반환합니다.

Array 정렬이 보장되지 않습니다. 정렬해야 하는 Array 작업(예: BinarySearch)을 수행하기 전에 정렬 Array 해야 합니다.

네이 Array 티브 코드에서 포인터 개체를 사용하는 것은 지원되지 않으며 여러 메서드에 NotSupportedException 대해 throw됩니다.

속성

IsFixedSize

Array의 크기가 고정되어 있는지 여부를 나타내는 값을 가져옵니다.

IsReadOnly

Array가 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

IsSynchronized

Array에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.

Length

모든 차원의 Array에서 요소의 총수를 가져옵니다.

LongLength

Array의 모든 차원에 있는 요소의 총 수를 나타내는 64비트 정수를 가져옵니다.

MaxLength

배열에 포함될 수 있는 최대 요소 수를 가져옵니다.

Rank

Array의 순위(차원 수)를 가져옵니다. 예를 들어, 1차원 배열은 1을 반환하고, 2차원 배열은 2를 반환하는 방식입니다.

SyncRoot

Array에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

메서드

AsReadOnly<T>(T[])

지정한 배열의 읽기 전용 래퍼를 반환합니다.

BinarySearch(Array, Int32, Int32, Object)

배열의 각 요소 및 지정한 값에서 구현되는 IComparable 인터페이스를 사용하여 1차원으로 정렬된 배열의 요소 범위에서 값을 검색합니다.

BinarySearch(Array, Int32, Int32, Object, IComparer)

지정한 IComparer 인터페이스를 사용하여 1차원으로 정렬된 배열의 요소 범위에서 값을 검색합니다.

BinarySearch(Array, Object)

배열의 각 요소 및 지정한 개체에서 구현되는 IComparable 인터페이스를 사용하여 1차원으로 정렬된 배열에서 특정 요소를 검색합니다.

BinarySearch(Array, Object, IComparer)

지정한 IComparer 인터페이스를 사용하여 1차원으로 정렬된 전체 배열에서 값을 검색합니다.

BinarySearch<T>(T[], Int32, Int32, T)

Array의 각 요소 및 지정한 값에서 구현되는 IComparable<T> 제네릭 인터페이스를 사용하여 1차원으로 정렬된 배열의 요소 범위에서 값을 검색합니다.

BinarySearch<T>(T[], Int32, Int32, T, IComparer<T>)

지정한 IComparer<T> 제네릭 인터페이스를 사용하여 1차원으로 정렬된 배열의 요소 범위에서 값을 검색합니다.

BinarySearch<T>(T[], T)

Array의 각 요소 및 지정한 개체에서 구현되는 IComparable<T> 제네릭 인터페이스를 사용하여 1차원으로 정렬된 전체 배열에서 특정 요소를 검색합니다.

BinarySearch<T>(T[], T, IComparer<T>)

지정한 IComparer<T> 제네릭 인터페이스를 사용하여 1차원으로 정렬된 전체 배열에서 값을 검색합니다.

Clear(Array)

배열의 내용을 지웁니다.

Clear(Array, Int32, Int32)

배열의 각 요소 형식의 기본값으로 요소의 범위를 설정합니다.

Clone()

Array의 부분 복사본을 만듭니다.

ConstrainedCopy(Array, Int32, Array, Int32, Int32)

Array의 요소 범위를 지정한 소스 인덱스부터 복사하여 지정된 대상 인덱스부터 시작하는 다른 Array에 붙여 넣습니다. 복사가 완료되지 않으면 모든 변경 내용이 취소되도록 합니다.

ConvertAll<TInput,TOutput>(TInput[], Converter<TInput,TOutput>)

한 형식의 배열을 다른 형식의 배열로 변환합니다.

Copy(Array, Array, Int32)

Array의 요소 범위를 첫 번째 요소부터 복사하여 다른 Array에 첫 번째 요소부터 붙여넣습니다. 길이가 32비트 정수로 지정되어 있습니다.

Copy(Array, Array, Int64)

Array의 요소 범위를 첫 번째 요소부터 복사하여 다른 Array에 첫 번째 요소부터 붙여넣습니다. 길이가 64비트 정수로 지정되어 있습니다.

Copy(Array, Int32, Array, Int32, Int32)

Array의 요소 범위를 지정한 소스 인덱스부터 복사하여 지정된 대상 인덱스부터 시작하는 다른 Array에 붙여 넣습니다. 길이와 인덱스가 32비트 정수로 지정되어 있습니다.

Copy(Array, Int64, Array, Int64, Int64)

Array의 요소 범위를 지정한 소스 인덱스부터 복사하여 지정된 대상 인덱스부터 시작하는 다른 Array에 붙여 넣습니다. 길이와 인덱스가 64비트 정수로 지정되어 있습니다.

CopyTo(Array, Int32)

현재 1차원 배열의 모든 요소를 지정된 대상 배열 인덱스부터 시작하여 지정된 1차원 배열에 복사합니다. 인덱스가 32비트 정수로 지정되어 있습니다.

CopyTo(Array, Int64)

현재 1차원 배열의 모든 요소를 지정된 대상 배열 인덱스부터 시작하여 지정된 1차원 배열에 복사합니다. 인덱스가 64비트 정수로 지정되어 있습니다.

CreateInstance(Type, Int32)

지정한 Type 및 길이를 가진 인덱스가 0부터 시작하는 1차원 Array를 만듭니다.

CreateInstance(Type, Int32, Int32)

0부터 시작하는 인덱스를 사용하여 지정된 Type 및 차원 길이의 2차원 Array를 만듭니다.

CreateInstance(Type, Int32, Int32, Int32)

지정한 Type 및 차원 길이를 가진 인덱스가 0부터 시작하는 삼차원 Array를 만듭니다.

CreateInstance(Type, Int32[])

지정한 Type 및 차원 길이를 가진 인덱스가 0부터 시작하는 다차원 Array를 만듭니다. 차원 길이가 32비트 정수 배열로 지정되어 있습니다.

CreateInstance(Type, Int32[], Int32[])

지정한 하한을 사용하여 지정한 Array 및 차원 길이의 다차원 Type 을 만듭니다.

CreateInstance(Type, Int64[])

지정한 Type 및 차원 길이를 가진 인덱스가 0부터 시작하는 다차원 Array를 만듭니다. 차원 길이가 64비트 정수 배열로 지정되어 있습니다.

Empty<T>()

빈 배열을 반환합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Exists<T>(T[], Predicate<T>)

지정한 배열에 지정한 조건자에 정의된 조건과 일치하는 요소가 포함되어 있는지를 확인합니다.

Fill<T>(T[], T)

지정된 array의 각 요소에 T 형식의 지정된 value을 할당합니다.

Fill<T>(T[], T, Int32, Int32)

다음 count 수와 startIndex 범위 내에 있는 지정된 array 요소에 T 형식의 지정된 value을 할당합니다.

Find<T>(T[], Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하고 전체 Array에서 처음으로 검색한 요소를 반환합니다.

FindAll<T>(T[], Predicate<T>)

지정한 조건자에 정의된 조건과 일치하는 모든 요소를 검색합니다.

FindIndex<T>(T[], Int32, Int32, Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하고 지정된 인덱스부터 시작하여 지정된 수의 요소를 포함하는 Array의 요소 범위에서 일치하는 요소 중 첫 번째 요소의 인덱스(0부터 시작)를 반환합니다.

FindIndex<T>(T[], Int32, Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하여 지정된 인덱스에서 마지막 요소로 확장하는 Array의 요소 범위에서 일치하는 요소 중 첫 번째 요소의 인덱스(0부터 시작)를 반환합니다.

FindIndex<T>(T[], Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하여 전체 Array에서 일치하는 요소 중 첫 번째 요소의 인덱스(0부터 시작)를 반환합니다.

FindLast<T>(T[], Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하고 전체 Array에서 마지막으로 검색한 요소를 반환합니다.

FindLastIndex<T>(T[], Int32, Int32, Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하여 지정된 수의 요소가 들어 있고 지정된 인덱스에서 끝나는 Array 의 요소 범위에서 일치하는 요소 중 마지막 요소의 인덱스(0부터 시작)를 반환합니다.

FindLastIndex<T>(T[], Int32, Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하여 첫 번째 요소에서 지정된 인덱스로 확장하는 Array의 요소 범위에서 일치하는 요소 중 마지막 요소의 인덱스(0부터 시작)를 반환합니다.

FindLastIndex<T>(T[], Predicate<T>)

지정된 조건자에 정의된 조건과 일치하는 요소를 검색하여 전체 Array에서 일치하는 요소 중 마지막 요소의 인덱스(0부터 시작)를 반환합니다.

ForEach<T>(T[], Action<T>)

지정한 배열의 각 요소에서 지정한 동작을 수행합니다.

GetEnumerator()

IEnumerator 에 대한 Array를 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLength(Int32)

지정된 차원의 Array에 있는 요소의 수를 나타내는 32비트 정수를 가져옵니다.

GetLongLength(Int32)

지정된 차원의 Array에 있는 요소의 수를 나타내는 64비트 정수를 가져옵니다.

GetLowerBound(Int32)

배열에서 지정된 차원의 첫 번째 요소의 인덱스를 가져옵니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
GetUpperBound(Int32)

배열에서 지정된 차원의 마지막 요소의 인덱스를 가져옵니다.

GetValue(Int32)

1차원 Array의 지정한 위치에서 값을 가져옵니다. 인덱스가 32비트 정수로 지정되어 있습니다.

GetValue(Int32, Int32)

2차원 Array의 지정한 위치에 있는 값을 가져옵니다. 인덱스가 32비트 정수로 지정되어 있습니다.

GetValue(Int32, Int32, Int32)

3차원 Array의 지정한 위치에서 값을 가져옵니다. 인덱스가 32비트 정수로 지정되어 있습니다.

GetValue(Int32[])

다차원 Array의 지정한 위치에서 값을 가져옵니다. 인덱스가 32비트 정수 배열로 지정되어 있습니다.

GetValue(Int64)

1차원 Array의 지정한 위치에서 값을 가져옵니다. 인덱스가 64비트 정수로 지정되어 있습니다.

GetValue(Int64, Int64)

2차원 Array의 지정한 위치에 있는 값을 가져옵니다. 인덱스가 64비트 정수로 지정되어 있습니다.

GetValue(Int64, Int64, Int64)

3차원 Array의 지정한 위치에서 값을 가져옵니다. 인덱스가 64비트 정수로 지정되어 있습니다.

GetValue(Int64[])

다차원 Array의 지정한 위치에서 값을 가져옵니다. 인덱스가 64비트 정수 배열로 지정되어 있습니다.

IndexOf(Array, Object)

지정한 개체를 검색하여 1차원 배열에서 처음 검색된 개체의 인덱스를 반환합니다.

IndexOf(Array, Object, Int32)

1차원 배열의 요소 범위에서 지정한 개체를 검색하여 처음으로 일치하는 인덱스를 반환합니다. 범위는 지정한 인덱스에서 배열의 끝까지 확장됩니다.

IndexOf(Array, Object, Int32, Int32)

1차원 배열의 요소 범위에서 지정한 개체를 검색하여 처음으로 일치하는 인덱스를 반환합니다. 범위는 지정한 요소 수에 대해 지정한 인덱스에서 확장됩니다.

IndexOf<T>(T[], T)

지정한 개체를 검색하여 1차원 배열에서 처음 검색된 개체의 인덱스를 반환합니다.

IndexOf<T>(T[], T, Int32)

1차원 배열의 요소 범위에서 지정한 개체를 검색하여 처음으로 일치하는 인덱스를 반환합니다. 범위는 지정한 인덱스에서 배열의 끝까지 확장됩니다.

IndexOf<T>(T[], T, Int32, Int32)

1차원 배열의 요소 범위에서 지정한 개체를 검색하여 처음으로 일치하는 인덱스를 반환합니다. 범위는 지정한 요소 수에 대해 지정한 인덱스에서 확장됩니다.

Initialize()

해당 값 형식의 매개 변수가 없는 생성자를 호출하여 값 형식 Array의 모든 요소를 초기화합니다.

LastIndexOf(Array, Object)

지정한 개체를 검색하여 전체 1차원 Array내에서 마지막으로 검색된 값의 인덱스를 반환합니다.

LastIndexOf(Array, Object, Int32)

지정한 개체를 검색하여 첫 번째 요소에서 지정한 인덱스로 확장하는 1차원 Array 의 요소 범위에서 마지막으로 검색된 요소의 인덱스를 반환합니다.

LastIndexOf(Array, Object, Int32, Int32)

지정한 개체를 검색하여 지정한 수의 요소를 포함하고 지정한 인덱스에서 끝나는 1차원 Array 의 요소 범위에서 마지막으로 검색된 요소의 인덱스를 반환합니다.

LastIndexOf<T>(T[], T)

지정한 개체를 검색하여 전체 Array에서 마지막으로 검색된 요소의 인덱스를 반환합니다.

LastIndexOf<T>(T[], T, Int32)

지정한 개체를 검색하여 첫 번째 요소에서 지정한 인덱스로 확장하는 Array 의 요소 범위에서 마지막으로 검색된 요소의 인덱스를 반환합니다.

LastIndexOf<T>(T[], T, Int32, Int32)

지정한 개체를 검색하여 지정한 수의 요소를 포함하고 지정한 인덱스에서 끝나는 Array 의 요소 범위에서 마지막으로 검색된 요소의 인덱스를 반환합니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
Resize<T>(T[], Int32)

1차원 배열의 요소 수를 지정된 새로운 크기로 변경합니다.

Reverse(Array)

1차원 Array전체에 있는 요소의 시퀀스를 역순으로 설정합니다.

Reverse(Array, Int32, Int32)

1차원 Array에 있는 요소의 하위 집합 시퀀스를 역순으로 설정합니다.

Reverse<T>(T[])

1차원 제네릭 배열에서 요소의 시퀀스를 역순으로 설정합니다.

Reverse<T>(T[], Int32, Int32)

1차원 제네릭 배열 요소에서 하위 집합 시퀀스를 역방향으로 정렬합니다.

SetValue(Object, Int32)

값을 1차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 32비트 정수로 지정되어 있습니다.

SetValue(Object, Int32, Int32)

값을 2차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 32비트 정수로 지정되어 있습니다.

SetValue(Object, Int32, Int32, Int32)

값을 3차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 32비트 정수로 지정되어 있습니다.

SetValue(Object, Int32[])

값을 다차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 32비트 정수 배열로 지정되어 있습니다.

SetValue(Object, Int64)

값을 1차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 64비트 정수로 지정되어 있습니다.

SetValue(Object, Int64, Int64)

값을 2차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 64비트 정수로 지정되어 있습니다.

SetValue(Object, Int64, Int64, Int64)

값을 3차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 64비트 정수로 지정되어 있습니다.

SetValue(Object, Int64[])

값을 다차원 Array에 있는 지정한 위치의 요소로 설정합니다. 인덱스가 64비트 정수 배열로 지정되어 있습니다.

Sort(Array)

Array 에 있는 각 요소의 IComparable 구현을 사용하여 1차원 Array전체의 요소를 정렬합니다.

Sort(Array, Array)

Array 구현을 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 1차원 IComparable 개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)를 정렬합니다.

Sort(Array, Array, IComparer)

지정한 Array 를 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 1차원 IComparer개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)를 정렬합니다.

Sort(Array, Array, Int32, Int32)

각 키의 Array 구현을 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 1차원 IComparable 개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)의 요소 범위를 정렬합니다.

Sort(Array, Array, Int32, Int32, IComparer)

지정한 Array 를 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 1차원 IComparer개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)의 요소 범위를 정렬합니다.

Sort(Array, IComparer)

지정한 Array 를 사용하여 1차원 IComparer의 요소를 정렬합니다.

Sort(Array, Int32, Int32)

Array 에 있는 각 요소의 IComparable 구현을 사용하여 1차원 Array의 요소 범위에 있는 요소를 정렬합니다.

Sort(Array, Int32, Int32, IComparer)

지정한 Array를 사용하여 1차원 IComparer의 요소 범위에 있는 요소를 정렬합니다.

Sort<T>(T[])

Array 에 있는 각 요소의 IComparable<T> 제네릭 인터페이스 구현을 사용하여 전체 Array의 요소를 정렬합니다.

Sort<T>(T[], Comparison<T>)

지정한 Array 을 사용하여 Comparison<T>의 요소를 정렬합니다.

Sort<T>(T[], IComparer<T>)

지정한 Array 제네릭 인터페이스를 사용하여 IComparer<T> 의 요소를 정렬합니다.

Sort<T>(T[], Int32, Int32)

Array 에 있는 각 요소의 IComparable<T> 제네릭 인터페이스 구현을 사용하여 Array의 요소 범위에 있는 요소를 정렬합니다.

Sort<T>(T[], Int32, Int32, IComparer<T>)

지정한 Array 제네릭 인터페이스를 사용하여 IComparer<T> 의 요소 범위에 있는 요소를 정렬합니다.

Sort<TKey,TValue>(TKey[], TValue[])

각 키의 Array 제네릭 인터페이스 구현을 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 IComparable<T> 개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)를 정렬합니다.

Sort<TKey,TValue>(TKey[], TValue[], IComparer<TKey>)

지정한 Array 제네릭 인터페이스를 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 IComparer<T> 개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)를 정렬합니다.

Sort<TKey,TValue>(TKey[], TValue[], Int32, Int32)

각 키에서 구현하는 Array 제네릭 인터페이스를 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 IComparable<T> 개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)의 요소 범위를 정렬합니다.

Sort<TKey,TValue>(TKey[], TValue[], Int32, Int32, IComparer<TKey>)

지정한 Array 제네릭 인터페이스를 사용하여 첫 번째 Array 에 있는 키를 기반으로 하는 한 쌍의 IComparer<T> 개체(키를 포함하는 개체와 해당 항목을 포함하는 개체)의 요소 범위를 정렬합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
TrueForAll<T>(T[], Predicate<T>)

배열의 모든 요소가 지정한 조건자에 정의된 조건과 일치하는지를 확인합니다.

명시적 인터페이스 구현

ICollection.Count

Array에 포함된 요소 수를 가져옵니다.

ICollection.IsSynchronized

Array에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지 여부를 나타내는 값을 가져옵니다.

ICollection.SyncRoot

Array에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

IList.Add(Object)

이 메서드를 호출하면 NotSupportedException 예외가 항상 throw됩니다.

IList.Clear()

IList에서 항목을 모두 제거합니다.

IList.Contains(Object)

IList에 요소가 있는지 여부를 확인합니다.

IList.IndexOf(Object)

IList에서 특정 항목의 인덱스를 결정합니다.

IList.Insert(Int32, Object)

항목을 IList의 지정된 인덱스에 삽입합니다.

IList.IsFixedSize

Array의 크기가 고정되어 있는지 여부를 나타내는 값을 가져옵니다.

IList.IsReadOnly

Array이 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

IList.Item[Int32]

지정한 인덱스에 있는 요소를 가져오거나 설정합니다.

IList.Remove(Object)

IList에서 맨 처음 발견되는 특정 개체를 제거합니다.

IList.RemoveAt(Int32)

지정한 인덱스에서 IList 항목을 제거합니다.

IStructuralComparable.CompareTo(Object, IComparer)

정렬 순서에서 현재 컬렉션 개체의 위치가 다른 개체보다 앞인지, 뒤인지 또는 동일한지를 확인합니다.

IStructuralEquatable.Equals(Object, IEqualityComparer)

개체가 현재 인스턴스와 같은지 여부를 확인합니다.

IStructuralEquatable.GetHashCode(IEqualityComparer)

현재 인스턴스의 해시 코드를 반환합니다.

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

스레드 보안

공용 정적 (Shared Visual Basic의)이 형식의 멤버는 스레드로부터 안전 합니다. 인스턴스 구성원은 스레드로부터의 안전성이 보장되지 않습니다.

이 구현은 동기화된(스레드로부터 안전한) 래퍼를 Array제공하지 않습니다. 그러나 .NET 클래스는 Array 속성을 사용하여 SyncRoot 자체 동기화된 버전의 컬렉션을 제공합니다.

컬렉션 전체를 열거하는 프로시저는 기본적으로 스레드로부터 안전하지 않습니다. 컬렉션이 동기화되어 있을 때 다른 스레드에서 해당 컬렉션을 수정할 수 있으므로 이렇게 되면 열거자에서 예외가 throw됩니다. 열거하는 동안 스레드로부터 안전을 보장하려면 전체 열거를 수행하는 동안 컬렉션을 잠그거나 다른 스레드에서 변경된 내용으로 인해 발생한 예외를 catch하면 됩니다.

추가 정보