String utility routines.
Alias for procedure.
Converts given string to lower case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | string |
Input/output string. |
Alias for procedure.
Converts given string to upper case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | string |
Input/output string. |
Alias for procedure.
Returns given string in lower case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to convert. |
Result.
Alias for procedure.
Returns given string in upper case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to convert. |
Result.
Converts hexadecimal number to integer.
Returns hexadecimal value as 4-byte integer. The input string must
start with 0x
or 0X
. The routine returns the following error
codes in error
:
E_FORMAT
if string is not in expected format.E_INVALID
if string does not start with 0x
.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Hex. string of value. |
||
integer(kind=i4), | intent(out) | :: | value |
Value. |
||
integer, | intent(out), | optional | :: | error |
Error. |
Returns hexadecimal value as 8-byte integer. The input string must
start with 0x
or 0X
. The routine returns the following error
codes in error
:
E_FORMAT
if string is not in expected format.E_INVALID
if string does not start with 0x
.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Hex. string of value. |
||
integer(kind=i8), | intent(out) | :: | value |
Value. |
||
integer, | intent(out), | optional | :: | error |
Error. |
Generic number to string converter.
Returns string representation of given 4-byte integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i4), | intent(in) | :: | value |
Input. |
||
character(len=:), | intent(out), | allocatable | :: | string |
Output. |
|
integer, | intent(out), | optional | :: | error |
Error code. |
Returns string representation of given 8-byte integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i8), | intent(in) | :: | value |
Input. |
||
character(len=:), | intent(out), | allocatable | :: | string |
Output. |
|
integer, | intent(out), | optional | :: | error |
Error code. |
Returns string representation of given 4-byte real.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r4), | intent(in) | :: | value |
Input. |
||
character(len=:), | intent(out), | allocatable | :: | string |
Output. |
|
integer, | intent(out), | optional | :: | error |
Error code. |
Returns string representation of given 8-byte real.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8), | intent(in) | :: | value |
Input. |
||
character(len=:), | intent(out), | allocatable | :: | string |
Output. |
|
integer, | intent(out), | optional | :: | error |
Error code. |
Generic string to number converter.
Converts string to 2-byte integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input. |
||
integer(kind=i2), | intent(out) | :: | value |
Output. |
||
integer, | intent(out), | optional | :: | error |
Error code. |
Converts string to 4-byte integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input. |
||
integer(kind=i4), | intent(out) | :: | value |
Output. |
||
integer, | intent(out), | optional | :: | error |
Error code. |
Converts string to 8-byte integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input. |
||
integer(kind=i8), | intent(out) | :: | value |
Output. |
||
integer, | intent(out), | optional | :: | error |
Error code. |
Converts string to 4-byte real.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input. |
||
real(kind=r4), | intent(out) | :: | value |
Output. |
||
integer, | intent(out), | optional | :: | error |
Error code. |
Converts string to 8-byte real.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input. |
||
real(kind=r8), | intent(out) | :: | value |
Output. |
||
integer, | intent(out), | optional | :: | error |
Error code. |
Derived type of allocatable character to be stored in an array.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | data |
String data. |
Counts occurences of character a
in string
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input. |
||
character(len=1), | intent(in) | :: | a |
Character to count. |
||
integer, | intent(in), | optional | :: | n |
String length. |
Returns the number of line breaks in string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | string |
Input string. |
Returns the number of occurences of string2
in string1
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string1 |
Haystack string. |
||
character(len=*), | intent(in) | :: | string2 |
Needle string. |
Returns .true.
if given allocatable string is not passed, not
allocated, or contains only white spaces.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=:), | intent(inout), | optional, | allocatable | :: | string |
Input string. |
Returns .true.
if given string is present and not empty.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in), | optional | :: | string |
Input string. |
Returns .true.
if all characters is given string are printable
ASCII characters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to validate. |
Returns given string in lower case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to convert. |
Result.
Returns given string in upper case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to convert. |
Result.
Returns .true.
if string1
starts with string2
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string1 |
First string. |
||
character(len=*), | intent(in) | :: | string2 |
Second string. |
Allocates string type to empty character of length 0 or n
, if not
allocated already.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(inout) | :: | string |
String type. |
||
integer, | intent(in), | optional | :: | n |
Length of string data. |
Deallocates allocatable character inside of string type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(inout) | :: | string |
String type. |
Converts given string to lower case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | string |
Input/output string. |
Replaces character a
in string
with b
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | string |
String to parse. |
||
character(len=1), | intent(in) | :: | a |
Character to replace. |
||
character(len=1), | intent(in) | :: | b |
Substitute character. |
Splits a string by a given delimiter into an array of strings.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to split. |
||
character(len=*), | intent(inout) | :: | array(:) |
Splitted components. |
||
character(len=*), | intent(in) | :: | del |
Delimiter. |
||
integer, | intent(out), | optional | :: | n |
Number of array elements. |
Converts given string to upper case.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | string |
Input/output string. |