isPunct()

Last revision:2025/04/24

名称

isPunct()

説明

文字が区切り文字(コンマ、セミコロン、感嘆符など)であるかを調べる。入力された文字が区切り文字であれば、trueを返す。

書式

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

isPunct(thisChar)

C言語シグネチャ(avr)

inline boolean isPunct(int c);

引数

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

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

戻り値

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

コード例

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

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

  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");
  }
}

void loop() {
}

参照

訳者註

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

オリジナルのページ

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

実装の解析

まだ解析していません。

最終更新日

July 12, 2026

inserted by FC2 system