Answers for "search in array dart"

0

dart find in array

list.contains(x);
Posted by: Guest on March-09-2021
0

search in array dart

// as data strucure
void searchArray(int key,) {
    bool isFound = false;
    for (int i = 0; i < arr.length; i++) {
      if (arr[i] == key) {
        print("The Item is found $key and The index is $i");
        isFound = true;
        return;
      }
    }
    if (!isFound) {
      print('Not found');
      return;
    }
  }
Posted by: Guest on January-23-2022

Code answers related to "Dart"

Browse Popular Code Answers by Language