stdlib_ascii moduleThe stdlib_ascii module provides procedures for handling and manipulating
intrinsic character variables and constants.
stdlib_asciiNULNull character
SOHStart Of Heading Character
STXStart Of Text character
ETXEnd Of Text character
EOTEnd Of Transmission character
ENQEnquiry character
ACKAcknowledge character
BELBell character
BSBackspace character
TABHorizontal Tab character
LFLine Feed character
VTVertical Tab character
FFForm Feed character
CRCarriage Return character
SOShift Out character
SIShift In character
DLEData Link Escape character
DC1Device Control 1 character
DC2Device Control 2 character
DC3Device Control 3 character
DC4Device Control 4 character
NAKNegative Acknowledge character
SYNSynchronous Idle character
ETBEnd of Transmission Block character
CANCancel character
EMEnd of Medium character
SUBSubstitute character
ESCEscape character
FSFile separator character
GSGroup Separator character
RSRecord Separator character
USUnit separator character
DELDelete character
fullhex_digitsAll the hexadecimal digits (0-9, A-F, a-f)
hex_digitsAll the numerical and uppercase hexadecimal digits (0-9, A-F)
lowerhex_digitsAll the numerical and lowercase hexadecimal digits (0-9, a-f)
digitsbase 10 digits (0-9)
octal_digitsbase 8 digits (0-7)
lettersUppercase and lowercase letters of the english alphabet (A-Z, a-z)
uppercaseUppercase english albhabets (A-Z)
lowercaseLowercase english albhabets (a-z)
whitespaceAll the ascii whitespace characters (space, horizontal tab, vertical tab, carriage return, line feed, form feed)
stdlib_ascii proceduresis_alphaExperimental
Checks whether input character is an ASCII letter (A-Z, a-z).
res = is_alpha (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_alphanumExperimental
Checks whether input character is an ASCII letter or a number (A-Z, a-z, 0-9).
res = is_alphanum (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_asciiExperimental
Checks whether input character is in the ASCII character set i.e in the range 0-128.
res = is_ascii (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_controlExperimental
Checks whether input character is a control character.
res = is_control (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_digitExperimental
Checks whether input character is a digit (0-9).
res = is_digit (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_octal_digitExperimental
Checks whether input character is an octal digit (0-7)
res = is_octal_digit (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_hex_digitExperimental
Checks whether input character is a hexadecimal digit (0-9, A-F, a-f).
res = is_hex_digit (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_punctuationExperimental
Checks whether input character is a punctuation character.
res = is_punctuation (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_graphicalExperimental
Checks whether input character is a graphical character (printable other than the space character).
res = is_graphical (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_printableExperimental
Checks whether input character is a printable character (including the space character).
res = is_printable (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_lowerExperimental
Checks whether input character is a lowercase ASCII letter (a-z).
res = is_lower (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_upperExperimental
Checks whether input character is an uppercase ASCII letter (A-Z).
res = is_upper (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_whiteExperimental
Checks whether input character is a whitespace character (which includes space, horizontal tab, vertical tab, carriage return, linefeed and form feed characters)
res = is_white (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
is_blankExperimental
Checks whether input character is a blank character (which includes space and tabs).
res = is_blank (c)
Elemental function.
c: shall be an intrinsic character(len=1) type. It is an intent(in) argument.
The result is a logical.
to_lowerExperimental
Converts input character variable to all lowercase.
res = to_lower (string)
Elemental function.
string: shall be an intrinsic character type. It is an intent(in) argument.
The result is an intrinsic character type of the same length as string.
program example_to_lower
use stdlib_ascii, only: to_lower
implicit none
print'(a)', to_lower("HELLo!") ! returns "hello!"
end program example_to_lower
to_upperExperimental
Converts input character variable to all uppercase.
res = to_upper (string)
Elemental function.
string: shall be an intrinsic character type. It is an intent(in) argument.
The result is an intrinsic character type of the same length as string.
program example_to_upper
use stdlib_ascii, only: to_upper
implicit none
print'(a)', to_upper("hello!") ! returns "HELLO!"
end program example_to_upper
to_titleExperimental
Returns the titlecase version of the input character variable.
Title case: First character of every word in the sentence is converted to
uppercase and the rest of the characters are converted to lowercase.
A word is a contiguous sequence of character(s) which consists of alphabetical
character(s) and numeral(s) only and doesn't exclude any alphabetical character
or numeral present next to either of its 2 ends.
res = to_title (string)
Elemental function.
string: shall be an intrinsic character type. It is an intent(in) argument.
The result is an intrinsic character type of the same length as string.
program example_to_title
use stdlib_ascii, only: to_title
implicit none
print *, to_title("hello there!") ! returns "Hello There!"
print *, to_title("'enquoted'") ! returns "'Enquoted'"
print *, to_title("1st") ! returns "1st"
end program example_to_title
to_sentenceExperimental
Returns the sentencecase version of the input character variable.
The first alphabetical character of the sequence is transformed to uppercase
unless it follows a numeral. The rest of the characters in the sequence are
transformed to lowercase.
res = to_sentence (string)
Elemental function.
string: shall be an intrinsic character type. It is an intent(in) argument.
The result is an intrinsic character type of the same length as string.
program example_to_sentence
use stdlib_ascii, only: to_sentence
implicit none
print *, to_sentence("hello!") ! returns "Hello!"
print *, to_sentence("'enquoted'") ! returns "'Enquoted'"
print *, to_sentence("1st") ! returns "1st"
end program example_to_sentence
reverseExperimental
Reverses the order of all characters in the input character type.
res = reverse (string)
Elemental function.
string: shall be an intrinsic character type. It is an intent(in) argument.
The result is an intrinsic character type of the same length as string.
program example_reverse
use stdlib_ascii, only: reverse
implicit none
print'(a)', reverse("Hello, World!") ! returns "!dlroW ,olleH"
end program example_reverse