當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。