Ruby | Array delete() operation
Array#delete() : delete() is a Array class method which returns the array after deleting the mentioned elements. It can also delete a particular element in the array.
Syntax: Array.delete() Parameter: obj - specific element to delete Return: last deleted values from the array.
Code #1 : Example for delete() method
delete : 5 delete : no such element delete :
Code #2 : Example for delete() method
delete : abc delete : no such element delete : cat