c#查找string数组的某一个值的索引

string[] array = { "A","B","C","D","H"};

  var index=array.ToList().IndexOf("D");
使用IndexOf()方法,返回数组元素在数组中的索引。
  index=3;
 
 
转自:https://www.cnblogs.com/mbtq/p/5810125.html
posted @ 2018-05-20 10:47  redhairboy  阅读(23691)  评论(0编辑  收藏  举报