Analyze if a char is a space character. Returns true if the input char is a space or horizontal tab ('\t').
Use the following function to evaluate a char variable:
isWhitespace(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 space character.
char myChar = '\t'; // try with 'a' for a non space char
void setup() {
Serial.begin(9600);
if (isWhitespace(myChar)) { // tests if myChar is a space character
Serial.println("The character is a space or tab");
} else {
Serial.println("The character is not a space or tab");
}
}
void loop() {
}