循环输邮索引值,使用for是没有任何问题:

Foreach循环输出索引值

 

 class Bh
    {
        public string[] str { get; set; }

        public void TestFor()
        {
            for (int i = 0; i < str.Length; i++)
            {
                Console.WriteLine("index:{0},Value:{1}", i, str[i]);
            }
        }
    }
Source Code

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2022-01-15
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案