判断是否有重复,判断字符串是否有重复汉字【c#】
string corn = "公司";
int n = 0;
if (tbCorporateName.Text.IndexOf(corn) > -1)
{
string cor = tbCorporateName.Text.Replace(corn, "");
n = (tbCorporateName.Text.Length - cor.Length) / corn.Length;
}
if (n >= 2) {
lblMessage.Text = "请输入单个公司名称。";
Result = false;
}

浙公网安备 33010602011771号