This module implements basic string handling routines.
The specification of this module is available here.
Remove trailing characters in set from string. If no character set is provided trailing whitespace is removed.
Version: experimental
Remove trailing characters in set from string. Default character set variant where trailing whitespace is removed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string |
Remove trailing characters in set from string. Default character set variant where trailing whitespace is removed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Remove trailing characters in set from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=1), | intent(in) | :: | set(:) |
Remove trailing characters in set from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=1), | intent(in) | :: | set(:) |
Remove trailing substrings from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | substring |
Remove trailing substrings from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | substring |
Remove trailing substrings from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | substring |
Remove trailing substrings from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | substring |
Returns the number of times substring 'pattern' has appeared in the input string 'string' Specifications
Returns the number of times substring 'pattern' has appeared in the input string 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
logical, | intent(in), | optional | :: | consider_overlapping |
Returns the number of times substring 'pattern' has appeared in the input string 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
logical, | intent(in), | optional | :: | consider_overlapping |
Returns the number of times substring 'pattern' has appeared in the input string 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
logical, | intent(in), | optional | :: | consider_overlapping |
Returns the number of times substring 'pattern' has appeared in the input string 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
logical, | intent(in), | optional | :: | consider_overlapping |
Check whether a string ends with substring or not
Version: experimental
Check whether a string ends with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | substring |
Check whether a string ends with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | substring |
Check whether a string ends with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | substring |
Check whether a string ends with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | substring |
Finds the starting index of substring 'pattern' in the input 'string' Specifications
Version: experimental
Returns the starting index of the 'occurrence'th occurrence of substring 'pattern' in input 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
integer, | intent(in), | optional | :: | occurrence | ||
logical, | intent(in), | optional | :: | consider_overlapping |
Returns the starting index of the 'occurrence'th occurrence of substring 'pattern' in input 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
integer, | intent(in), | optional | :: | occurrence | ||
logical, | intent(in), | optional | :: | consider_overlapping |
Returns the starting index of the 'occurrence'th occurrence of substring 'pattern' in input 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
integer, | intent(in), | optional | :: | occurrence | ||
logical, | intent(in), | optional | :: | consider_overlapping |
Returns the starting index of the 'occurrence'th occurrence of substring 'pattern' in input 'string' Returns an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
integer, | intent(in), | optional | :: | occurrence | ||
logical, | intent(in), | optional | :: | consider_overlapping |
Left pad the input string Specifications
Left pad the input string with " " (1 whitespace)
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length |
Left pad the input string with the 'pad_with' character
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length | |||
character(len=1), | intent(in) | :: | pad_with |
Left pad the input string with " " (1 whitespace)
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length |
Left pad the input string with the 'pad_with' character
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length | |||
character(len=1), | intent(in) | :: | pad_with |
Right pad the input string Specifications
Right pad the input string with " " (1 whitespace)
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length |
Right pad the input string with the 'pad_with' character
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length | |||
character(len=1), | intent(in) | :: | pad_with |
Right pad the input string with " " (1 whitespace)
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length |
Right pad the input string with the 'pad_with' character
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length | |||
character(len=1), | intent(in) | :: | pad_with |
Replaces all the occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Version: experimental
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
type(string_type), | intent(in) | :: | replacement |
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | replacement |
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
type(string_type), | intent(in) | :: | replacement |
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
type(string_type), | intent(in) | :: | replacement |
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | replacement |
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | replacement |
Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
type(string_type), | intent(in) | :: | replacement |
Replaces all the occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | replacement |
Extracts characters from the input string to return a new string
Version: experimental
Extract the characters from the region between 'first' and 'last' index (both inclusive) of the input 'string' by taking strides of length 'stride' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
integer, | intent(in), | optional | :: | first | ||
integer, | intent(in), | optional | :: | last | ||
integer, | intent(in), | optional | :: | stride |
Extract the characters from the region between 'first' and 'last' index (both inclusive) of the input 'string' by taking strides of length 'stride' Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
integer, | intent(in), | optional | :: | first | ||
integer, | intent(in), | optional | :: | last | ||
integer, | intent(in), | optional | :: | stride |
Check whether a string starts with substring or not
Version: experimental
Check whether a string starts with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | substring |
Check whether a string starts with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | substring |
Check whether a string starts with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
type(string_type), | intent(in) | :: | substring |
Check whether a string starts with substring or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
character(len=*), | intent(in) | :: | substring |
Remove leading and trailing whitespace characters.
Version: experimental
Remove leading and trailing whitespace characters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string |
Remove leading and trailing whitespace characters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Format or transfer other types as a string. (Specification)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int16), | intent(in) | :: | value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int64), | intent(in) | :: | value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int8), | intent(in) | :: | value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical(kind=lk), | intent(in) | :: | value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int16), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int64), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int8), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical(kind=lk), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in) | :: | value | |||
character(len=*), | intent(in), | optional | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(in) | :: | value | |||
character(len=*), | intent(in), | optional | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | value | |||
character(len=*), | intent(in), | optional | :: | format |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in) | :: | value | |||
character(len=*), | intent(in), | optional | :: | format |
Left pad the input string with zeros. Specifications
Left pad the input string with zeros
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_type), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length |
Left pad the input string with zeros
Returns a new string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string | |||
integer, | intent(in) | :: | output_length |