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.
我有一个像这样的数组: ["data","data2"]
将其转换为带括号的字符串的最类似于 Ruby 的方法是什么:“['data','data2']”
谢谢
我不能说这是多么“红宝石”,但这是我通常会做的:
puts "['" + array_of_strings.join("','") + "']"