just wondering if there is a way to check if the value of A is equal to ANY value inside the array (without using the large loop functions) - sort of like the Where function.
eg.
if (DataRow[column1value] == <any value within>Array A[]) { //do... }
Hurrah!
In .NET 3.5 or higher, using LINQ:
bool found = yourArray.Contains(yourValue);
In earlier versions of the structure:
bool found = Array.IndexOf(yourArray, yourValue) > -1;
if(myArray.Contains(A)){...}
yourArray.Any(item => item != null && item.Equals(yourvalue));
Array.Contains
.
,
int[] array = new int[] { 1, 2, 3, 4, 5 }; if (array.Contains(5)) { }
, IndexOf(), ,
IndexOf()
Source: https://habr.com/ru/post/1724309/More articles:How do you set up a menu system (buttons with a click) in C ++ / directx? - c ++How to get webpage source in ASP.NET C #? - methodsError 403: Forbidden. An HTTP request was denied using the Anonymous client authentication scheme - javaAggregation inside a foreach loop - c #Make a win C # console application to show the posibile command when the user hits TAB - c #List Sort (Win32 / C ++) - c ++problem using xsl method for each - xmlWPF GUI / GUI Management - c #Screenshots of selenium using rspec - ruby ββ| fooobar.comRDP over TCP proxy - proxyAll Articles