Getting the array key in a 'foreach' loop

前端 未结 9 587
别跟我提以往
别跟我提以往 2021-02-03 22:42

How do I get the key of the current element in a foreach loop in C#?

For example:

PHP

foreach ($array as $key => $value)
{
             


        
9条回答
提交回复
热议问题