【发布时间】:2017-02-01 10:29:39
【问题描述】:
我有一个通过百分比字符串的多行字符串数组,如下所示:
array = %w(test
foo
bar)
我想在foo 条目中添加评论消息,类似于
array = %w(test
# TODO: Remove this line after fix #1
foo
bar)
有没有办法不把它转换成这样的基本数组?
array = ['test',
# TODO: Remove this line after fix #1
'foo',
'bar']
【问题讨论】: