c#数组获取元素的索引
Given a Collection<T> of integer types, and an index, we have to access the element from the given index.
给定一个整数类型的Collection <T>和一个索引,我们必须从给定索引访问元素。
To access an element of the Collection<T>, we use Collection<T>.Item[Int32 index] property.
要访问Collection <T>的元素,我们使用Collection <T> .Item [Int32 index]属性 。
Syntax:
句法:
Collection<T>.Item[Int32 index];
Note: It may return exception (ArgumentOutOfRangeException), if index is either less than 0 or greater than the count.
注意:如果index小于0或大于count,则它可能返回异常( ArgumentOutOfRangeException )。