Answers for "solidity remove from array"

0

solidity remove from array

// 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();
Posted by: Guest on September-30-2021
0

how to pop elemt in array solidity

delete array[index];
Posted by: Guest on June-27-2021

Browse Popular Code Answers by Language