using System.Text.RegularExpressions;
public class Test
{
static void Main()
{
string s = GetTest("sdfdf");
s = GetTest("334324#");
s = GetTest("34324");
}
static string GetTest(string s)
{
if (Regex.Match(s, "^\\d+$").Success)
{
return "数字";
}
else if (Regex.Match(s, "^[a-zA-Z]+$").Success)
{
return "字符";
}
else
{
return "其他结果";
}
}
}
