Description

Analyze if a char is alpha (that is a letter). Returns true if the input char contains a letter.

Syntax

Use the following function to evaluate a char variable:

isAlpha(thisChar)

Parameters

The function admits the following parameter:

thisChar: char variable to evaluate. Allowed data types: char.

Returns

The function returns true if the evaluated input variable is alpha.

Example Code

char myChar = 'A'; // try with '#' for a non alpha char

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

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

void loop() {
}

See also