Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
ToArray()
When you use this method for collections, what is the name of the new array that you've just made? How do you access it?
2 Respostas
+ 2
ToArray() returns an array.
storehere = ListToBeConverted.ToArray()
+ 1
Here an example with this ToArray() copy method:
using System;
using System.Collections;
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
myAL.Add( "array" );
myAL.Add( "list" );
String[] myArr = (String[]) myAL.ToArray( typeof( string ) );