isSpace

説明

charが空白文字であるかどうかを解析します。引数がスペース、フォームフィード(’f’)、ニューライン(’n’)、キャリッジリターン(’r’)、ホリゾンタルタブ(’t’)、バーティカルタブ(’v’)のいずれかであればtrueを返します。

構文

isSpace(thisChar)

thisChar:変数。許容されるデータ型:char

戻り値

thisCharが空白文字の場合はtrue、そうでない場合はfalse。

プログラム例

if (isSpace(myChar)) {  // tests if myChar is a white-space character
  Serial.println("The character is white-space");
}
else {
  Serial.println("The character is not white-space");
}

関連項目

char

if (条件付き演算子)

タイトルとURLをコピーしました