Analyze if a char is a white-space character. Returns true if the input char is a space, form feed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), or vertical tab ('\v').
Use the following function to evaluate a char variable:
isSpace(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 white-space character.
char myChar = '\n'; // try with 'a' for a non white space char
void setup() {
Serial.begin(9600);
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");
}
}
void loop() {
}