Analyze if a char is punctuation (that is a comma, a semicolon, an exclamation mark and so on). Returns true if the input char is punctuation.
Use the following function to evaluate a char variable:
isPunct(thisChar)
The function admits the following parameter:
thisChar: char variable to evaluate. Allowed data types: char.
The function returns true if the evaluated input variable is a punctuation.
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() {
}