using System; using System.Globalization; using System.Linq; using System.Collections.Generic; public class Test { public static void Main() { string myString = "words words words FIRSTPHRASE these words I want SECONDPHRASE but not these words"; int indexOfFirstPhrase = myString.IndexOf("FIRSTPHRASE"); string result = myString; if(indexOfFirstPhrase >= 0) { indexOfFirstPhrase += "FIRSTPHRASE".Length; result = myString.Substring(indexOfFirstPhrase); int indexOfSecondPhrase = myString.IndexOf("SECONDPHRASE", indexOfFirstPhrase); if (indexOfSecondPhrase >= 0) { result = myString.Substring(indexOfFirstPhrase, indexOfSecondPhrase - indexOfFirstPhrase); } } Console.WriteLine(result); } }