StringStack
This library has all the functions to use solidity string array as a struct
pushToStack
function pushToStack(string[] _stack, string _element) external pure returns (string[])
Push element to array in the first position As the array has fixed size, we drop the last element when addind a new one to the beginning of the array
Parameters
Name | Type | Description |
---|---|---|
_stack | string[] | String stack |
_element | string | String to be added to the stack |
Return Values
Name | Type | Description |
---|---|---|
[0] | string[] | Modified stack |
popFromStack
function popFromStack(string[] _stack) external pure returns (string[], string)
stackLength
function stackLength(string[] _stack) public pure returns (uint256)
seeLastInStack
function seeLastInStack(string[] _stack) public pure returns (string)