Skip to content

Instantly share code, notes, and snippets.

@aromig
Created January 25, 2016 15:23
Show Gist options
  • Save aromig/b31f12d37a9c5772bae4 to your computer and use it in GitHub Desktop.
Save aromig/b31f12d37a9c5772bae4 to your computer and use it in GitHub Desktop.
Check to see if a string exists in a string array
public static bool IsInArray(string[] array, string value)
{
foreach (string member in array)
{
if (member == value)
{
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment