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


Arduino isDigit()用法及代碼示例

[人物]

說明

分析 char 是否為數字(即數字)。如果 thisChar 是數字,則返回 true。

用法

isDigit(thisChar)

參數

thisChar:變量。允許的數據類型:char

返回

true :如果 thisChar 是一個數字。

示例代碼

if (isDigit(myChar)) {  // tests if myChar is a digit
  Serial.println("The character is a number");
}
else {
  Serial.println("The character is not a number");
}

相關用法


注:本文由純淨天空篩選整理自arduino.cc大神的英文原創作品 isDigit()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。