C# 判斷數組中是否存在某個值
方法1
1 int[] ia = {1,2,3}; 2 int id = Array.IndexOf(ia,1); // 這里的1就是你要查找的值
方法2
1 string[] strArr = {"a","b","c","d","e"}; 2 bool exists = ((IList)strArr).Contains("a");
參考網址
[1] http://www.rzrgm.cn/superelement/p/7691229.html
有志者,事竟成,破釜沉舟,百二秦關終屬楚; 苦心人,天不負,臥薪嘗膽,三千越甲可吞吳。

浙公網安備 33010602011771號