What is is_lower(c) in Fortran?

is_lower(c) is a public pure function in the stdlib_ascii module: this module provides methods to manipulate and handle intrinsic character variables and constants.

The is_lower() function checks whether its argument is a lowercase ASCII letter (a–z) or not.

A sample input

Syntax

public pure function is_lower(c)

Parameters

  • c is the character to test.

Return value

The function returns a logical value.

It will return true if the character is a lowercase ASCII letter and false otherwise.

Example

The code snippet below demonstrates the use of is_lower in Fortran:

#include <stdlib.h>
answer = is_lower('b');
print *, answer

When the code above is run, the result will be as shown below:

true

Free Resources