Horje
c# loop array Code Example
c# loop through array
//iterate the array
for (int i = 0; i < arr.Length; i++)
{
  // loop ...
}
// or
foreach (var element in arr)
{
  // loop ...
}
c# loop string array
//Using Linq to itterate over an array
var strArr = new string[4] {"one", "Two", "Three", "Four"};
Console.WriteLine(strArr.Select((s, i) => $"Item no: {i + 1}, Value: {s}"));
c# loop array
  Debug.Assert((theData.Length % 3) == 0);  // 'theData' will always be divisible by 3

  for (int i = 0; i < theData.Length; i += 3)
  {
       //grab 3 items at a time and do db insert, 
       // continue until all items are gone..
       string item1 = theData[i+0];
       string item2 = theData[i+1];
       string item3 = theData[i+2];
       // use the items
  }
c# loop through array
 for (int i = 0; i < theData.Length - 2; i+=3) 
    { 

        // use theData[i], theData[i+1], theData[i+2]

    } 




Csharp

Related
c# multiple exceptions same handler Code Example c# multiple exceptions same handler Code Example
by value by reference c# Code Example by value by reference c# Code Example
pointer in c# Code Example pointer in c# Code Example
c# list item not in another list Code Example c# list item not in another list Code Example
how to save file on shared file xamarin forms Code Example how to save file on shared file xamarin forms Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10