假设我有一个这样的字符串:
string source = "Today is friday! I'm am having trouble programming this. Today is friday! Tomorrow is saturday. Today is friday!"
我想搜索这个字符串,抓住所有说“今天是星期五!”的句子,然后用我刚刚找到的句子创建一个新字符串。
上述字符串的预期结果是:
string output = "Today is friday!Today is friday!Today is friday!"
编辑:LINQ 不是强制性的。
谢谢!