ruby - Is there a particular function to retrieve then delete random array element? -
i know can in couple of steps, wondering if there function can achieve this.
i want array#sample, remove element retrieved.
how this:
array.delete_at(rand(array.length))
Comments
Post a Comment