C# array function
-
Upload
steven-clark -
Category
Education
-
view
2.358 -
download
3
description
Transcript of C# array function
![Page 1: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/1.jpg)
C# Array FunctionMore info:
www.completecsharptutorial.com
![Page 2: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/2.jpg)
FAQ
• What is array?• What is array function?• Array function• How to use array function?
![Page 3: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/3.jpg)
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.
![Page 4: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/4.jpg)
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.
![Page 5: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/5.jpg)
Array Function
There are various array function is available in C#. Some of them are:
• Sort();• Clear();• Copy();
![Page 6: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/6.jpg)
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
![Page 7: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/7.jpg)
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
![Page 8: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/8.jpg)
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
![Page 9: C# array function](https://reader036.fdocuments.net/reader036/viewer/2022081821/54c4585f4a795940678b4573/html5/thumbnails/9.jpg)
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.