string a="abcde"; string b="cd"; if(a.IndexOf(b)>=0) MessageBox.Show("a包含b"); else MessageBox.Show("a不包含b");