C# Array Methods

Beginner
6 min read
Updated: Nov 2026
32 method guides
Method index

About This Index

This page is the C# Array Methods index. Each row links to a full guide with syntax, parameters, return value, three examples, and FAQs.

Learn what an array is on /c-sharp/array. Use this page when you need a specific API such as Sort(), Find(), or IndexOf().

Fixed length.

A C# array cannot grow after it is created. Prefer List<T> when you need Add and Remove. Array.Resize allocates a new array behind a ref.

How to Call an Array Method

Static helpers use Array.; instance members use a dot on the array variable:

C#
int[] nums = { 4, 8, 15, 16, 23 };

Array.Sort(nums);                    // static
int ix = Array.IndexOf(nums, 15);    // static
int first = (int)nums.GetValue(0);   // instance
object copy = nums.Clone();          // instance

C# Array Methods Table

All method guides in this C# tutorial series (32 tutorials), grouped by purpose.

Creation & wrapping

4 methods

Create arrays at runtime, share an empty array, clone, or wrap as read-only.

MethodDescriptionTutorial
CreateInstance()Create a new array at runtime by element type and lengths.Try it
Empty()Return a shared empty array of type T without allocating each time.Try it
Clone()Make a shallow copy of the array as an object.Try it
AsReadOnly()Wrap a T[] as a read-only collection without copying elements.Try it

Copying

3 methods

Copy elements between arrays. ConstrainedCopy rolls back on failure.

MethodDescriptionTutorial
Copy()Copy a range of elements from one array to another.Try it
CopyTo()Copy this array into another array starting at an index.Try it
ConstrainedCopy()Copy a range and roll back the destination if the copy fails.Try it

Searching

10 methods

Find values by equality or by a predicate (a small test function).

MethodDescriptionTutorial
BinarySearch()Fast search for a value in a sorted array; returns the index or a negative bitwise complement.Try it
IndexOf()Return the first index of a value, or -1 if it is missing.Try it
LastIndexOf()Return the last index of a value, or -1 if it is missing.Try it
Find()Return the first element that matches a predicate, or default if none match.Try it
FindAll()Return a new array of every element that matches a predicate.Try it
FindIndex()Return the index of the first element that matches a predicate, or -1.Try it
FindLast()Return the last element that matches a predicate, or default if none.Try it
FindLastIndex()Return the index of the last predicate match, or -1.Try it
Exists()Return true if any element matches a predicate.Try it
TrueForAll()Return true only if every element matches a predicate.Try it

Sorting & rearranging

6 methods

Sort, reverse, resize, clear a range, fill values, or re-run field initializers.

MethodDescriptionTutorial
Sort()Sort the elements of an array in place (ascending by default).Try it
Reverse()Reverse the order of elements in an array (or a range) in place.Try it
Resize()Replace an array with a new one of a different length (ref parameter).Try it
Clear()Set a range of elements to their default values (0 / null / false).Try it
Fill()Set every element (or a range) to the same value.Try it
Initialize()Re-run field initializers on value-type elements in the array.Try it

Element access & bounds

6 methods

Read or write by index, and ask about length and lower/upper bounds (including multi-dimensional arrays).

MethodDescriptionTutorial
GetValue()Read an element by index as object (works for any Array rank).Try it
SetValue()Write an element by index through the Array API.Try it
GetLength()Return the number of elements in a given dimension (int).Try it
GetLongLength()Return the length of a dimension as a long.Try it
GetLowerBound()Return the starting index of a dimension (usually 0).Try it
GetUpperBound()Return the last valid index of a dimension.Try it

Iteration & conversion

3 methods

Walk every element, get an enumerator, or map each element to a new type.

MethodDescriptionTutorial
ForEach()Run an action once for every element in a T[] array.Try it
GetEnumerator()Return an enumerator used by foreach to walk elements.Try it
ConvertAll()Create a new array by converting each element with a converter function.Try it

Frequently Asked Questions

They are helpers on System.Array for creating, copying, searching, sorting, and inspecting arrays. Many are static (Array.Sort(arr)); some are instance methods (arr.Clone(), arr.GetLength(0)).
This index lists 32 guides: creation, copying, searching (including predicates), sorting and rearranging, element access and bounds, plus iteration helpers.
A predicate is a small test function that returns true or false for one element. You often write it as a lambda: x => x > 10. Find, FindAll, Exists, and TrueForAll use predicates.
Use arrays when the length is fixed and known. Use List<T> when you need Add, Remove, or frequent growth. Many Array.* methods also work on arrays that List.ToArray() returns.
Read the C# Arrays hub first. Then open Sort(), IndexOf(), Find(), and Copy() from the tables below.

Start with Sort()

Order an array in place, then practice IndexOf and BinarySearch.

Sort() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful