.net 判断字符串中是否包含空格

string detail = "12345 6";
if (detail.IndexOf(" ") >= 0)
{
AlertMessage.Show(this, "请不要输入空格");
return;
}

猜你喜欢

转载自www.cnblogs.com/zttb/p/9210263.html