Answers for "c# count element in an array"

C#
2

c# count element in an array

string[] empty = new string[5];
var totalElements = empty.Count(); //5

string[] animals = { "Cat", "Alligator", "fox", "donkey", "Cat", "alligator" };
totalElements = animals.Count(); //6

int[] nums = { 1, 2, 3, 4, 3, 55, 23, 2, 5, 6, 2, 2 };
totalElements = nums.Count(); //12
Posted by: Guest on July-10-2020

Code answers related to "c# count element in an array"

C# Answers by Framework

Browse Popular Code Answers by Language