更新时间:2023-02-21 10:15:01
)。成功;
}
").Success; }
这种方法是否正确?
Is this method is correct?
你可以简单地检查如下。
只需添加命名空间
使用系统。 linq
int PasswordSpecialChar = txtMonth.Text.Count(p =>!char.IsLetterOrDigit(p));
you can simply check like below.
just add namespace
using system.linq
int PasswordSpecialChar = txtMonth.Text.Count(p => !char.IsLetterOrDigit(p));
没有。
例如,您的解决方案不适用于大写字母。试试这个:
No.
Your solution will not work with upper case, for example. Try this:
return Regex.Match(stringToTest, @"^\W+