当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Arduino isPunct()用法及代码示例


[人物]

说明

分析 char 是否为标点符号(即逗号、分号、感叹号等)。如果 thisChar 是标点符号,则返回 true。

用法

isPunct(thisChar)

参数

thisChar:变量。允许的数据类型:char

返回

true :如果 thisChar 是标点符号。

示例代码

if (isPunct(myChar)) {  // tests if myChar is a punctuation character
  Serial.println("The character is a punctuation");
}
else {
  Serial.println("The character is not a punctuation");
}

相关用法


注:本文由纯净天空筛选整理自arduino.cc大神的英文原创作品 isPunct()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。