I have an array of multiple types ( Int32 | Char | String )
and need to remove a specific element.
Is there a simple way to do that?
I have an array of multiple types ( Int32 | Char | String )
and need to remove a specific element.
Is there a simple way to do that?
You may use Array(T).delete_at(index) to delete an element at a given index in your array, or Array(T).delete(obj) that deletes all elements in the array that are equal to obj
Inspired by Shree's now deleted answer
new_arr = arr.reject{ |element| element == "whatever"}
or could use reject!