I have the following array.
@arr = ["Ac,Ab,Aa", "Ba,Bb,Bd", "Ca,Cc,Cb", "Dd,Da,Dc", "aA,aC,aD", "bD,bA,bB", "cB,cA,cC", "dD,dC,dA"]
Now I want to extract the first two letters of each item.
@firsttwo = ["Ac", "Ba", "Ca", "Dd", "aA", "bD", "cB", "dD"]
How can I achieve this in Ruby.
I tried this but it didn't work.
@firsttwo = @combi.select{ |item| item[0, 1]}