isControl()

Last revision:2025/04/24

名称

isControl()

説明

文字が制御文字であるかを調べる。入力された文字が制御文字であれば、trueを返す。

書式

文字変数を評価するには、以下の関数を使う。

isControl(thisChar)

C言語シグネチャ(avr)

inline boolean isControl(int c);

引数

この関数は以下の引数を受け付ける。

thisChar調べたい文字。データ型: char

戻り値

この関数は、評価した入力変数が制御文字の場合、trueを返す。

コード例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
char myChar = '\n'; // try with 'n' for a non control char

void setup() {
  Serial.begin(9600);

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

void loop() {
}

参照

訳者註

内部ではiscntrl()を呼び出しています。

オリジナルのページ

https://docs.arduino.cc/language-reference/en/functions/characters/isControl/

実装の解析

まだ解析していません。

最終更新日

August 16, 2026

inserted by FC2 system