【发布时间】:2019-11-02 18:50:33
【问题描述】:
我们有一个这样的文本..
This is text
i want
to keep
but
Replace this sentence
because i dont like it.
现在我想替换这句话Replace this sentence because i dont like it.
当然会这样
text = text.Replace(@"Replace this sentence because i dont like it.", "");
无法解决我的问题。 我不能删除换行符并用一行替换它们。
我的输出应该是
This is text
i want
to keep
but
请记住,我不喜欢的句子有很多变体和换行符。
I.E 它可能会像
Replace this
sentence
because i dont like it.
或
Some text before. Replace this
sentence
because i dont like it.
【问题讨论】:
标签: c#