xxxxxxxxxx
// If you don't care about ordering
arr[removeIndex] = arr[arr.length - 1];
arr.pop();
// Perserves order
for (uint i = removeIndex; i < arr.length - 1; i++) {
arr[i] = arr[i+1];
}
arr.pop();
xxxxxxxxxx
uint[] temp_arr;
function removeElement(uint value) public {
delete temp_arr;
for (uint i; i<arr_items.length; ++i) {
if (arr_items[i] != value) {
temp_arr.push(arr_items[i]);
}
}
arr_items = temp_arr;
}
xxxxxxxxxx
function removePayee(uint256 index) internal returns (uint[] memory payeesNew) {
if (index >= payees.length) return;
for (uint i = 0; i<payees.length-1; i++){
if (i != index) {
payeesNew[payeesNew.length] = payees[i]);
}
}
}`