admin管理员组

文章数量:1571330


a=["one", "two", "three"]
b=["two", "one", "three"]

Now I want to sort array 'a' in the order of 'b', i.e

a.sort_by do |element|
  b.index(element)
end

本文标签: ArraysortOrderRuby