-4

検討:

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

1 に答える 1

6

https://stackoverflow.com/a/599373/1618257

List<string> elements = new List<string>();
foreach(xmlnode anode in somecollection)
{
  elements.Add("string");
}
于 2013-03-26T22:06:54.943 に答える