Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jul 10, 2022, 7:09 AM EDT
Uttam KumarRank #1,076 · 1.8K reputationPosted Jul 10, 2022, 12:18 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jul 10, 2022, 2:40 PM EDT
Tchokomeni Leo163 reputationPosted Jul 12, 2022, 1:48 PM EDT
You can use a list to get the number of item in your array.here is an example:
Listproject = new List(); foreach(var item in YourArray) { project.Add(item); } Console.WriteLine("Array length is {0}",project.Count);
Rajesh GamiRank #30 · 41.5K reputationPosted Jul 26, 2022, 5:54 AM EDT
Hello Daanish
If you want to find array length without using any in-build function then you can use foreach loop and get total count of loop.
int lengthCount=0; foreach(var item in ArrayList) { lengthCount=lengthCount+1; } Console.WriteLine("Total array length = {0}",lengthCount);