How to use IndexOf() method of List<object>

前端 未结 6 1690
遥遥无期
遥遥无期 2020-12-29 01:08

All the examples I see of using the IndexOf() method in List are of basic string types. What I want to know is how to return the index of

6条回答
  •  梦谈多话
    2020-12-29 01:39

    The answer is for those coming here to know why IndexOf() doesn't work.

    Your class must override Equals method of object possessing the following declaration.

    public override bool Equals(object obj)
    

提交回复
热议问题