如何检查字符是否在 C# 中的字母表中

Br4*_*000 -5 c# char alphabet

我觉得标题说的够多了。

void onClickSubmit(char submit)
{
     if(submit.//check if it is alphabetical)
     {
           //some code
     }
}
Run Code Online (Sandbox Code Playgroud)

我如何检查字符提交是否在字母表中?

sm.*_*lah 5

如果您的字母表只有 AZ 或 az,则可以使用正则表达式

char a = 'A';
bool isAlphaBet = Regex.IsMatch(a.ToString(), "[a-z]", RegexOptions.IgnoreCase);
if(isAlphaBet )
{
    //do this..
}
Run Code Online (Sandbox Code Playgroud)