KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to sort an array in particular order given in another array. EX: consider an array a=["one", "two", "three"] b=["two", "one", "three"] Now I want to sort array 'a' in the order of 'b', i.e a.each do |t| # It should be in the order of 'b' puts t end So the output should be two one three Any suggestions?
Tags (comma-separated)
Save Edits
Cancel