> For the complete documentation index, see [llms.txt](https://ubtechedu.gitbook.io/chinese/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ubtechedu.gitbook.io/chinese/arduino-language/structure/char/isalpha.md).

# isAlpha(thisChar)

判断一个字符是否是字母

### 参数

| 参数名      | 描述     |
| -------- | ------ |
| thisChar | 被解析的字符 |

### 返回

| 参数名 | 描述  |
| --- | --- |
| 布尔  | 真或假 |

### 例子

判断串口输入的字符是否为字母，是的话输出it's alpha。

```c
#include "uKitExplore2.h"
void setup() {
    Initialization();

}
void loop() {
    // 获取输入的数据
    if (Serial.available() > 0){
    char thisChar = Serial.read();

    // 查看发送的内容
        Serial.print("You sent me: \'");
        Serial.println(thisChar);
    // 分析发送的内容
        if(isAlpha(thisChar)){
              Serial.println("it's alpha");
        }
    else{
         Serial.println("it's not alpha");
    }
    }

}
```

上传程序，打开串口监视器，选择没有结束符，波特率选择115200。输入：1、A、\~，结果如下：&#x20;

![image.png](https://sjwx.easydoc.xyz/82335991/files/k0qdb3sf.png)
