a=[[1,2,3],[4,5,6],[7,8,9]]
a2=a.collect {|b| b[0..-2]}
Jared
Hue Mach Dieu wrote:
Hi All,
I have 2D array like this
A1: [[1,2,3],[4,5,6],[7,8,9]]
Now, I would like truncate the any column in array A1
For ex: A1: [[1,2,3],[4,5,6],[7,8,9]]
I truncate the column 1 of A1
The expected 2D array as like this
A2: [[2,3],[5,6],[8,9]]
Thank you for help
Hue
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general