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

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

posted on 2018-06-21 17:48  Smile向前  阅读(678)  评论(0编辑  收藏  举报