「C#」配列の要素を取得するサンプル
サンプル
using System;
namespace MyApplication
{
class Program
{
static void Main(string[] args)
{
string[] cft = {"A001", "B002", "C003", "D004"};
for (int i = 0; i < cft.Length; i++)
{
Console.WriteLine(cft[i]);
}
}
}
}
using System;
namespace MyApplication
{
class Program
{
static void Main(string[] args)
{
string[] cft = {"A001", "B002", "C003", "D004"};
for (int i = 0; i < cft.Length; i++)
{
Console.WriteLine(cft[i]);
}
}
}
}
using System; namespace MyApplication { class Program { static void Main(string[] args) { string[] cft = {"A001", "B002", "C003", "D004"}; for (int i = 0; i < cft.Length; i++) { Console.WriteLine(cft[i]); } } } }
実行結果
A001
B002
C003
D004