gpt4 book ai didi

ruby - 如何在 Ruby 单词数组快捷方式中输入 2 个或更多单词的字符串?

转载 作者:太空宇宙 更新时间:2023-11-03 17:41:50 25 4
gpt4 key购买 nike

我知道 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com