csharp Contains

//string collection
string[] myCodes = {"ABC123","ABC456"};
if (myCodes.Contains("ABC123"))
{
	//match found - do something!
}

//integer collection
int[] downloadOrdersHours = { 1, 5, 9, 13, 17, 21 };
if (downloadOrdersHours.Contains(DateTime.Now.Hour))
{
	DownloadOrders();
}
Example usage of Contains with a collection.

Updated: Monday 1st November 2010, 22:20am

There are 0 comments

Leave a comment of your own

Comments are currently closed.