Código PHP:
string[] nombres = { "juan", "palo", "jaime" };
for (int i = 0; i <= nombres.Length; i++) {
Console.WriteLine(nombres[i]);
}
class Sample
{
public static void Main()
{
string str = "abcdefg";
Console.WriteLine("1) The length of '{0}' is {1}", str, str.Length);
Console.WriteLine("2) The length of '{0}' is {1}", "xyz", "xyz".Length);
}
}