作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我有一个很长的字符串数组,是我用 %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/
我是一名优秀的程序员,十分优秀!