Static aELtype() As String = New String(31) {"PLOO", "PLOF", "PLFO", "PLFF", "iGh", "iGhL", "iGhR", "iGI", "iGIL", "iGIR", "iRp", "iRpL", "iRpR", "iRn", "iRnL", "iRnR", "iXON", "iBIN2", "iBIN3", "iVodd", "iVoddL", "iVoddR", "iVoss", "iVossL", "iVossR", "iCT_EN", "iCT_R", "iCT_G", "iCT_B", "TK_R", "TK_G", "TK_B"}

 

 

一般來說 都是用 index 的方式找陣列中的代表的值

但如果剛好要用  值 來找 陣列所對應的 index 這時需要請  Array 出場

 

這時 與 List 中的 Find 有異曲同工之妙

今日 我們想找 "PLOF" 所代表的 index

 Dim index As Integer = Array.FindIndex(Of String)(aELtype, Function(item As String) item = "PLOF")

 

這時 就可以很順利的找到  1

文章標籤
全站熱搜
創作者介紹
創作者 Rh 的頭像
Rh

程式狂想曲

Rh 發表在 痞客邦 留言(0) 人氣(385)