a=[1,2,3] a.collect{|x|x**2} puts a #结果1 2 3 a.collect!{|x|x**2} puts a #结果1 4 9
posted on 2012-12-02 23:20 VictorHan 阅读(174) 评论(0) 收藏 举报