using System;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
string[] s = { "PHP", "C", "C++", "C#", "Java", "JavaScript",
"VB.NET", "VB6", "Pascal", "Python"};
Console.WriteLine("Array.FindIndex(s, StartWithC): {0}",
Array.FindIndex(s, StartWithC));
}
private static bool StartWithC(String s)
{
if ((s.Substring(0, 1).ToLower() == "c"))
{
return true;
}
else
{
return false;
}
}
}
}
/*
run:
Array.FindIndex(s, StartWithC): 1
*/