Advertisement
Guest User

Untitled

a guest
Jul 26th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.66 KB | None | 0 0
  1. array1 = {"remarks"=>"remarks-1", "remarksbox"=>"hello"},{"remarks"=>"remarks-2", "remarksbox"=>"hello1"},
  2. {"remarks"=>"remarks 3", "remarksbox"=>"hello2"},{"remarks"=>"remarks 4", "remarksbox"=>"hello1"}
  3.  
  4. require an output like this
  5.  
  6. array2 = {"remarks"=>"remarks-1", "remarksbox"=>"hello", "remarks"=>"remarks-2", "remarksbox"=>"hello1",
  7.       "remarks"=>"remarks 3", "remarksbox"=>"hello2", "remarks"=>"remarks 4", "remarksbox"=>"hello1" }
  8.  
  9. another array3 consists {"remarks", "remarksbox"}
  10.  
  11. I need to match the values in array3 to array1, so I can get the values pointed by the keys
  12. array3 is an array of keys
  13. array is an array of {key1->value1, key2->value2}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement