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("','") + "']"