Answers for "get index of array element without indexof c#"

C#
14

c# find index element array

int[] arr = { 3, 6, 4, 1, 6, 8 };

// returns 1
Array.IndexOf(arr, 6);
Posted by: Guest on March-04-2020
0

get index of array element without indexof c#

for (let i = 0; i < arr.length; i++) {
    if (arr[i] === 6) {
      return i;
    }
  }
Posted by: Guest on August-31-2021

Code answers related to "get index of array element without indexof c#"

C# Answers by Framework

Browse Popular Code Answers by Language