string s1 = "abcdefgabcdefg"; string s2 = "cde"; int i1 = s1.IndexOf(s2); int i2 = s1.LastIndexOf(s2);