【发布时间】:2011-12-09 20:31:00
【问题描述】:
如何转换下面的字符串
"str 1<tab>str 2<tab>str 3<tab>str 4..........<tab>str n<tab and some whitespace>"
到
"*str 1*<tab>*str 2*<tab>*str 3*<tab>*str 4*..........<tab>*str n*<tab and some whitespace>"
其中 str 可以是“堆栈 - 溢出”或“超级:用户”,即包含一些空格和特殊字符的单词。
我知道我们可以使用 split 来解决这个问题。有没有办法只使用 =~ s///.. ?
提前致谢!
三位一体
【问题讨论】:
-
是
<tab>代表制表还是字面意思<tab>?