CSharp examples for System.Collections.Generic:Stack
Removes the element at the top of the stack and returns it.
using System;/*from ww w.j av a 2 s. c o m*/ public class Main{ /// <summary> /// Removes the element at the top of the stack and returns it. /// </summary> /// <param name="stack">The stack where the element at the top will be returned and removed.</param> /// <returns>The element at the top of the stack.</returns> public static System.Object Pop(System.Collections.ArrayList stack) { System.Object obj = stack[stack.Count - 1]; stack.RemoveAt(stack.Count - 1); return obj; } }