2013-02-13 2 views

답변

2

.FindIndex Method

List<String> hello = new List<String>(); 

hello.Add("red"); 
hello.Add("blue"); 

var index = hello.FindIndex(c => c == "red"); 
var word = hello[index]; //<-- get the word 

마지막 .ElementAt Method

var word = hello.ElementAt(0); 
+1

더 나은 직접 목록 인덱서를 사용하여 사용합니다. 더 관용적이고 빠릅니다. – usr

관련 문제