C# array function

Post on 25-Jan-2015

2.351 views 3 download

description

Array class provides number of predefined array function to work with array. It makes array manipulation easier. You can learn more about array function at:http://www.completecsharptutorial.com/basic/array-function.php

Transcript of C# array function

C# Array FunctionMore info:

www.completecsharptutorial.com

FAQ

• What is array?• What is array function?• Array function• How to use array function?

What is Array?

Array is a collection of value of same data type. It can store huge amount of different value in a single array variable. Array stores all the values on the specified index position. Using the index position the value can be retrieved or stored.

What is array function?

Array function is a way to manipulate array without investing much programming effort. There are numerous predefined array functions are available in C# library that makes array manipulation much easier.

Array Function

There are various array function is available in C#. Some of them are:

• Sort();• Clear();• Copy();

Sort() Function

The Sort() function sorts an array on ascending order. You can use Sort() function in programming as follow:

• Array.Sort(ArrayName);

• To know more about Sort() function visit:

www.completecsharptutorial.com

Clear() Function

The clear function removes the elements of array. It requires three parameters starting with arrayname, starting position and ending position. You can use Clear() function as follow:

Array.Clear(arr, 0, 3);

To know more about Clear() function visit: www.completecsharptutorial.com

Copy Function()

This function copies array elements to another array. It also requires three parameters starting with source array, destination array and starting position. You can use Copy function as follow:

Array.Copy(arr1,arr1,3);

To know more about Copy() function visit:

www.completecsharptutorial.com

Extra:

This is not entire list of array function. There are various array’s function and properties are out there. To know in details about array function and properties with suitable examples, please visit to:

www.completecsharptutorial.com

Thanks.