I have an array which looks like this:
arr = ["value1", "value2 spot", "value3", "value4", "value5 spot", "value6"]
and I would like to select and return an array with all values which have the spot substring.
arr.select{|v| v == regex_here}
how would I be able to do this?
.*\bspot\b.*a, b = arr.partition {|s| s[/spot/]}thenareturns true values,breturns false values.