我想:
1.9.3p392 :015 > a=["birds","things","people","people"]
=> ["birds", "things", "people","people"]
1.9.3p392 :016 > a.sample
=> "people"
1.9.3p392 :017 > a
=> ["birds", "things","people"]
1.9.3p392 :018 >
但看起来样本不支持这一点。我在样本的论点中遗漏了什么?我知道我可以删除返回的内容,但这将删除所有具有该值的成员,而不仅仅是那个单个实例。
谢谢