I am trying to come up with a good way to do the following. I have a string, such as this one:
foo = "bar = everybody\nbar = say\nbar = hey\nbar = ho"
And I am scanning through it like this:
foo.scan(/^bar = (.*)$/)
That returns:
[["everybody"], ["say"], ["hey"], ["ho"]]
What I want is:
["everybody", "say", "hey", "ho"]
So basically, I would either like to remove the singleton dimension of the array or reformat the scan code.
Any ideas?
Thanks!
Array#flatten may help