string toBeSearched = "code : "; string code = myString.Substring(myString.IndexOf(toBeSearched) + toBeSearched.Length);