c# check if array contains value
public static bool Contains(Array a, object val)
{
return Array.IndexOf(a, val) != -1;
}
c# check if array contains value
public static bool Contains(Array a, object val)
{
return Array.IndexOf(a, val) != -1;
}
how to check if an integer is in array c#
//Add necessary namespace
using System.Linq;
//Example
string[] printer = {"jupiter", "neptune", "pangea", "mercury", "sonic"};
//using .Contains() method
if(printer.Contains("jupiter"))
{
Process.Start("BLAH BLAH CODE TO ADD PRINTER VIA WINDOWS EXEC"");
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us