I am trying to extract something from an email. The general format of the email will always be:
blablablablabllabla hello my friend. [what I want] Goodbye
string s1 = "find a string between within a lengthy string"; string s2 = s1.IndexOf("between").ToString(); string output = s1.Substring(0, int.Parse(s2)); Console.WriteLine("string before between is : {0}", output); Console.ReadKey();