2013-03-26 87 views
-5

考虑:储存 '的foreach' 循环的每个值转换成字符串数组

string[] collection = new string[3]{"hi","hello","test"}; 
string [] elements = new string [3]; 
int index = 0; 
foreach(string anode in collection) 
{ 
    string[index++] = anode; 
} 
+0

什么是'somecollection'?你知道它会有(不超过)三个元素吗?每个元素需要什么字符串? – 2013-03-26 22:17:54

回答

相关问题