我知道 Ruby 单词数组:
a = %w( stackoverflow serverfault superuser)
我如何使用上面的代码显示一个列表,其中每个项目可以有 2 个或更多单词,例如:
a = ['stack overflow', 'server fault', 'super user']
最佳答案
a = %w( stack\ overflow server\ fault super\ user)
关于ruby - 如何在 Ruby 单词数组快捷方式中输入 2 个或更多单词的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1319542/