Let’s say I had a string like this:
string source = "Today is friday! I'm am having trouble programming this. Today is friday! Tomorrow is saturday. Today is friday!"
I want to search through this string, grab all the sentences that say “Today is friday!”, and create a new string with the sentences I just found.
The expected result from the above string is:
string output = "Today is friday!Today is friday!Today is friday!"
EDIT: LINQ is not mandatory.
Thanks!
Here’s a non-LINQ method of doing it: