1
我有一個散列數組,我想打入子數組數組。將數組拆分爲子數組
爲分體式的觸發是:組
master = []
master << { id: 1, group: "Brown", name: "Fred" }
master << { id: 2, group: "Brown", name: "May" }
master << { id: 3, group: "Brown", name: "Brian" }
master << { id: 4, group: "Black", name: "Sue" }
master << { id: 5, group: "Orange", name: "Helen" }
master << { id: 6, group: "Orange", name: "Peter" }
master << { id: 7, group: "Red", name: "Grace" }
master << { id: 8, group: "Red", name: "Michael" }
master << { id: 9, group: "Red", name: "Paul" }
是否有一個快速的軌道功能,可以實現這一點還是我需要爲我使用COBOL年前一樣使用控制斷型環.. :)
驚人的效率。 – Dercni 2014-11-24 22:04:40