can you loop through part of an array c# code example
Example 1: c# loop through array
//iterate the array
for (int i = 0; i < arr.Length; i++)
{
// loop ...
}
// or
foreach (var element in arr)
{
// loop ...
}
Example 2: C# loop through array of objet
List<string> names = new List<string>() { "Suresh Dasari", "Rohini Alavala", "Trishika Dasari" };
foreach (string name in names)
{
Console.WriteLine(name);
}