A module to deal with the manipulation of characters based on their ASCII collating sequence.
This module provides public parameters that are common ASCII cutoff values when dealing with alphanumeric characters.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | ZERO_ASCII | = | 48 | ASCII value of the digit '0' |
| integer, | public, | parameter | :: | NINE_ASCII | = | 57 | ASCII value of the digit '9' |
| integer, | public, | parameter | :: | UPPER_A_ASCII | = | 65 | ASCII VALUE of the character 'A' |
| integer, | public, | parameter | :: | UPPER_Z_ASCII | = | 90 | ASCII VALUE of the character 'Z' |
| integer, | public, | parameter | :: | LOWER_A_ASCII | = | 97 | ASCII VALUE of the character 'a' |
| integer, | public, | parameter | :: | LOWER_Z_ASCII | = | 122 | ASCII VALUE of the character 'z' |
| integer, | public, | parameter | :: | UPPER_LOWER_OFFSET | = | 32 | The difference between UPPER_A_ASCII and LOWER_A_ASCII |
Check if a character is alphanumeric This function checks the ASCII collating sequence of the passed character and returns true if the character is alpha (A-Z, a-z) or numeric (0-9)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |
Check if a character belongs to the alphabet This function checks the ASCII collating sequence of the passed character and returns true if the character belongs to the Roman alphabet.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |
Check if a character is a numerical digit. Return true if a character is between 0-9
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |
Check if a character is a lowercase alpha character Returns true if the ASCII value of char lies between LOWER_A_ASCII and LOWER_Z_ASCII
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |
Check if a character is a uppercase alpha character Returns true if the ASCII value of char lies between UPPER_A_ASCII and UPPER_Z_ASCII
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |
Convert an uppercase alpha character to its lowercase counterpart. If the passed character is not uppercase, return the same character.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |
Convert a lowercase alpha character to its uppercase counterpart. If the passed character is not lowercase, return the same character.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | char |