我有一个字符串:
"hello\t World\nbla"
我想把它分成:
["hello\t ","World\n","bla"]
我将如何在Ruby中执行此操作?
解决方法
>> "hello\t World\nbla".scan /\S+\s*/ => ["hello\t ","bla"]
"hello\t World\nbla"
我想把它分成:
["hello\t ","World\n","bla"]
我将如何在Ruby中执行此操作?
>> "hello\t World\nbla".scan /\S+\s*/ => ["hello\t ","bla"]