Dart Найти в массиве
list.contains(x);
Panicky Panther
list.contains(x);
// 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;
}
}