using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string[] array = { "c++", "csharp", "php", "java", "vb.net", "pascal"};
if (Array.IndexOf(array, "csharp", 0, 2) != -1) // index 0, 1, 2
Console.WriteLine("Found"); // Found
else
Console.WriteLine("Not Found");
if (Array.IndexOf(array, "csharp", 2, 4) != -1) // index 2, 3, 4
Console.WriteLine("Found");
else
Console.WriteLine("Not Found"); // Not Found
}
}
}
/*
run:
Found
Not Found
*/