clear

Summary

Clears the stack by removing all elements from the stack.

Usage

public void clear()

Description

Clears the stack by removing all elements from the stack.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
auto stack = new Stack<int>([ 1, 2, 3 ]);
Console.log(stack.length); // 3
stack.clear();
Console.log(stack.length); // 0

Share

HTML | BBCode | Direct Link