gpt4 book ai didi

ruby - 如何在 ruby​​ 中拆分很长的 %w 行

转载 作者:数据小太阳 更新时间:2023-10-29 09:01:06 24 4
gpt4 key购买 nike

我有一个很长的字符串数组,是我用 %w 写的

names = %w(FOO BAR BAZZ HELLO WORLD.....)

这是大约 500 多个字符的长行。为了便于阅读,我想拆分(也称为 WRAP)。

什么是推荐的方式?

最佳答案

在某些点改变线条。

names = %w(
FOO BAR BAZZ HELLO WORLD
FOO BAR BAZZ HELLO WORLD
FOO BAR BAZZ HELLO WORLD
FOO BAR BAZZ HELLO WORLD
FOO BAR BAZZ HELLO WORLD
...
)

关于ruby - 如何在 ruby​​ 中拆分很长的 %w 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35593660/

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