Skip to content

isUpperCase

gicking edited this page Feb 6, 2018 · 3 revisions

back to Command Reference / Characters

Description

Analyse if a char is upper case (that is a letter in upper case). Returns true if thisChar is upper case.

Inclusion

  • defined in misc.h
  • auto-loaded in main_general.h
  • no #define required

Syntax

isUpperCase(thisChar)

Parameters

  • input:

    • thisChar: character to test (char)
  • output:

    • none

Returns

  • true: if thisChar is upper case.
  • false: otherwise

Example Code

The below code reads a char from the terminal and checks for isUpperCase().

#include "main_general.h"
#include "uart1_blocking.h"
#include "putchar.h"

void setup() {

  // init UART, printf() and gets()
  UART1_begin(115200);
  putcharAttach(UART1_write);

} // setup

void loop() {

  if (UART1_available())
    if (isUpperCase(UART1_read()))
      printf("isUpperCase(x) = true\n");
    else
      printf("isUpperCase(x) = false\n");

}

Relevant Tutorial

  • tbd

See also

Clone this wiki locally