RUI3 (RAK Unified Interface 3) - RAK4631
Characters

Functions

boolean isAlphaNumeric (int thisChar) __attribute__((always_inline))
 
boolean isAlpha (int thisChar) __attribute__((always_inline))
 
boolean isAscii (int thisChar) __attribute__((always_inline))
 
boolean isWhitespace (int thisChar) __attribute__((always_inline))
 
boolean isControl (int thisChar) __attribute__((always_inline))
 
boolean isDigit (int thisChar) __attribute__((always_inline))
 
boolean isGraph (int thisChar) __attribute__((always_inline))
 
boolean isLowerCase (int thisChar) __attribute__((always_inline))
 
boolean isPrintable (int thisChar) __attribute__((always_inline))
 
boolean isPunct (int thisChar) __attribute__((always_inline))
 
boolean isSpace (int thisChar) __attribute__((always_inline))
 
boolean isUpperCase (int thisChar) __attribute__((always_inline))
 
boolean isHexadecimalDigit (int thisChar) __attribute__((always_inline))
 

Detailed Description

Function Documentation

◆ isAlphaNumeric()

boolean isAlphaNumeric ( int  thisChar)
Description
Analyse if a char is alphanumeric (that is a letter or a numbers). Returns true if thisChar contains either a number or a letter
Syntax
isAlphaNumeric(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is alphanumeric
FALSE: The character is not alphanumeric
Example
char mychar = 'A';

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

  if (isAlphaNumeric(myChar)) { // tests if myChar isa letter or a number
    Serial.println("The character is alphanumeric");
  }
  else {
    Serial.println("The character is not alphanumeric");
  }
}

void loop() {
}

◆ isAlpha()

boolean isAlpha ( int  thisChar)
Description
Analyse if a char is alpha (that is a letter). Returns true if thisChar contains a letter
Syntax
isAlpha(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is a letter
FALSE: The character is not a letter
Example
char mychar = 'A';

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

  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() {
}

◆ isAscii()

boolean isAscii ( int  thisChar)
Description
Analyse if a char is Ascii. Returns true if thisChar contains an Ascii character
Syntax
isAscii(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is Ascii
FALSE: The character is not Ascii
Example
char mychar = 'A';

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

  if (isAscii(myChar)) {  // tests if myChar is an Ascii character
    Serial.println("The character is Ascii");
  }
  else {
    Serial.println("The character is not Ascii");
  }
}

void loop() {
}

◆ isWhitespace()

boolean isWhitespace ( int  thisChar)
Description
Analyse if a char is a space character. Returns true if the argument is a space or horizontal tab ('')
Syntax
isWhitespace(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is a space or tab
FALSE: The character is not a space or tab
Example
char mychar = 'A';

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

  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() {
}

◆ isControl()

boolean isControl ( int  thisChar)
Description
Analyse if a char is a control character. Returns true if thisChar is a control character
Syntax
isControl(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is a control character
FALSE: The character is not a control character
Example
char mychar = 'A';

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

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

void loop() {
}

◆ isDigit()

boolean isDigit ( int  thisChar)
Description
Analyse if a char is a digit (that is a number). Returns true if thisChar is a number
Syntax
isDigit(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is a number
FALSE: The character is not a number
Example
char mychar = 'A';

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

  if (isDigit(myChar)) {  // tests if myChar is a digit
    Serial.println("The character is a number");
  }
  else {
    Serial.println("The character is not a number");
  }
}  

void loop() {
}

◆ isGraph()

boolean isGraph ( int  thisChar)
Description
Analyse if a char is printable with some content (space is printable but has no content). Returns true if thisChar is printable
Syntax
isGraph(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is printable
FALSE: The character is not printable
Example
char mychar = 'A';

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

  if (isGraph(myChar)) {  // tests if myChar is a printable character but not a blank space.
    Serial.println("The character is printable");
  }
  else {
    Serial.println("The character is not printable");
  }
}

void loop() {
}

◆ isLowerCase()

boolean isLowerCase ( int  thisChar)
Description
Analyse if a char is lower case (that is a letter in lower case). Returns true if thisChar contains a letter in lower case
Syntax
isLowerCase(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is lower case
FALSE: The character is not lower case
Example
char mychar = 'A';

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

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

void loop() {
}

◆ isPrintable()

boolean isPrintable ( int  thisChar)
Description
Analyse if a char is printable (that is any character that produces an output, even a blank space). Returns true if thisChar is printable
Syntax
isPrintAble(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is printable
FALSE: The character is not printable
Example
char mychar = 'A';

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

  if (isPrintable(myChar)) {  // tests if myChar is printable char
    Serial.println("The character is printable");
  }
  else {
    Serial.println("The character is not printable");
  }
}

void loop() {
}

◆ isPunct()

boolean isPunct ( int  thisChar)
Description
Analyse if a char is punctuation (that is a comma, a semicolon, an exclamation mark and so on). Returns true if thisChar is punctuation
Syntax
isPunct(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is a punctuation
FALSE: The character is not a punctuation
Example
char mychar = 'A';

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

  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() {
}

◆ isSpace()

boolean isSpace ( int  thisChar)
Description
Analyse if a char is a white-space character. Returns true if the argument is a space, form feed (''), newline ('
'), carriage return (''), horizontal tab (''), or vertical tab ('')
Syntax
isSpace(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is white-space
FALSE: The character is not white-space
Example
char mychar = 'A';

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

  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() {
}

◆ isUpperCase()

boolean isUpperCase ( int  thisChar)
Description
Analyse if a char is upper case (that is, a letter in upper case). Returns true if thisChar is upper case
Syntax
isUpperCase(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is upper case
FALSE: The character is not upper case
Example
char mychar = 'A';

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

  if (isUpperCase(myChar)) {  // tests if myChar is an upper case letter
    Serial.println("The character is upper case");
  }
  else {
    Serial.println("The character is not upper case");
  }
}

void loop() {
}

◆ isHexadecimalDigit()

boolean isHexadecimalDigit ( int  thisChar)
Description
Analyse if a char is an hexadecimal digit (A-F, 0-9). Returns true if thisChar contains an hexadecimal digit
Syntax
isHexadecimalDigit(thisChar);
Parameters
thisCharvariable(Type: char)
Returns
bool
Return values
TRUE: The character is an hexadecimal digit
FALSE: The character is not an hexadecimal digit
Example
char mychar = 'A';

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

  if (isHexadecimalDigit(myChar)) { // tests if myChar is an hexadecimal digit
    Serial.println("The character is an hexadecimal digit");
  }
  else {
    Serial.println("The character is not an hexadecimal digit");
  }
}   

void loop() {
}