Vidyalelo
Ruby Programming · Q18

Enumerators and Iterators in Ruby

Programming · Ruby Programming · question 18

Q18

What does the grep method do in Ruby enumerators?

A.
Sorts elements in a collection
B.
Filters elements in a collection based on a regular expression
Answer
C.
Removes duplicate elements from a collection
D.
None of the above

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board