Search object and returns the index within the range of Array offset in CSharp
Description
The following code shows how to search object and returns the index within the range of Array offset.
Example
/*from ww w . ja v a 2 s . c o m*/
using System;
public class Example
{
public static void Main()
{
string[] myValues = { "2001",
"1999",
"2000",
"1234",
"2002",
"2001",
"4567" };
Console.WriteLine(Array.IndexOf(myValues, "2001", 3));
}
}
The code above generates the following result.