假设我在一个名为“tao”的文件中有这个:
If you can talk about it, it ain't Tao. If it has a name, it's just another thing.
Tao doesn't have a name. Names are for ordinary things.
我想用ruby打开它,然后把它改成:
If you can talk about it, it ain't Tao. If it has a name, it's just another thing.
Tao doesn't have a name. Names are for ordinary things.
我知道如何读取文件,并将内容转换为字符串(让我们称之为tao_string
),但我不知道如何将单行中断更改为双行中断。我怀疑通过正则表达式,但我不知道从哪里开始。