Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚开始学习 Ruby,无法弄清楚这一点。假设我有一个数组:
s = ["p", "e", "n", "c", "i", "l"]
如何更改数组以使字符形成如下单词:
t = ["pencil"]
1.9.3-p194 :003 > s = ["p", "e", "n", "c", "i", "l"] => ["p", "e", "n", "c", "i", "l"] 1.9.3-p194 :004 > t = [s.join] => ["pencil"]