You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Write a program that extracts from a given text all sentences containing given word.
static void Main(string[] args)
{
string input = "We are living in a yellow submarine. We don't have anything else. Inside the submarine is very tight. So we are drinking all the day. We will move out of it in 5 days.";
string lookingFor = "in";
foreach (Match sentence in Regex.Matches(input, @"\s*([^\.]*\b" + lookingFor + @"\b.*?\.)"))