MemoryStorage.Remove(int) - YiZhang-Paul/Mock_Up_Calculator GitHub Wiki
Namespace: StorageClassLibrary
Description: Removes value at specified index.
Parameters | Description |
---|---|
key<int> | index of value to be removed |
Returns | Description |
---|---|
void | this method does not return anything |
Exceptions | Cause |
---|---|
ArgumentOutOfRangeException | key < 0 or key >= Size of storage |
Examples:
decimal[] values = { 1, 3, 5, 7 };
var storage = new MemoryStorage(values); //now contains [1, 3, 5, 7]
storage.Remove(0); //now contains [3, 5, 7]
storage.Remove(1); //now contains [3, 7]
storage.Remove(1); //now contains [3]
storage.Remove(1); //will throw exception