split后的是char用单引号,而replace后的为字符串则用双引号 if (cbb_HeadType.Text.Split('%').Count()==1) string str = cbb_HeadType.Text.Replace("%", "");