📅  最后修改于: 2022-03-11 14:48:40.358000             🧑  作者: Mango
string str = "ABC123";
if (Regex.IsMatch(str, "^[a-zA-Z0-9]*$"))
{
Console.WriteLine("Alphanumeric String");
}
else
{
Console.WriteLine("Non-Alphanumeric String");
}