How can I find the last element in a List<>?

后端 未结 13 1336
离开以前
离开以前 2020-12-12 21:43

The following is an extract from my code:

public class AllIntegerIDs 
{
    public AllIntegerIDs() 
    {            
        m_MessageID = 0;
        m_Messa         


        
13条回答
  •  情话喂你
    2020-12-12 22:09

    Use the Count property. The last index will be Count - 1.

    for (int cnt3 = 0 ; cnt3 < integerList.Count; cnt3++)
    

提交回复
热议问题