I had a more general need to remove one or more s columns that matched the text pattern (and not just delete the last column).
col_to_delete = 'b' arr = [["a","b","c"],[2,3,5],[3,6,8],[1,3,1]] arr.transpose.collect{|a| a if (a[0] != col_to_delete)}.reject(&:nil?).transpose => [["a", "c"], [2, 5], [3, 8], [1, 1]]
source share