怎么从Ruby数组中删除元素
1 回答
侃侃尔雅
TA贡献1801条经验 获得超16个赞
irb(main):001:0> a=[1,2,5,3,9,0,9]
=> [1, 2, 5, 3, 9, 0, 9]
irb(main):002:0> a-[2]
=> [1, 5, 3, 9, 0, 9]
irb(main):004:0> a
=> [1, 2, 5, 3, 9, 0, 9]
irb(main):005:0> a-[4]
=> [1, 2, 5, 3, 9, 0, 9]
- 1 回答
- 0 关注
- 1372 浏览
添加回答
举报
0/150
提交
取消