Stack.ToArray Method |
System.Collections.Stack
stackvariable .ToArray( )
An array of type Object
Creates an array of type Object, copies the elements of the stack in order, and then returns the array
Unlike the CopyTo method, the ToArray method does not require that we define an array in advance. However, we cannot specify the starting array index for the copy procedure.
Stack.CopyTo Method