strings Module



Contents


Interfaces

public interface adjustl

Adjusts the string to the left by removing any leading blanks and pushing any removed blanks onto the end of the string.

  • private pure elemental function string_adjustl(x) result(rst)

    Adjusts the string to the left by removing any leading blanks and pushing any removed blanks onto the end of the string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to adjust.

    Return Value type(string)

    The adjusted string.

public interface adjustr

Adjusts the string to the right by removing any trailing blanks and pushing any removed blanks onto the front of the string.

  • private pure elemental function string_adjustr(x) result(rst)

    Adjusts the string to the right by removing any trailing blanks and pushing any removed blanks onto the front of the string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to adjust.

    Return Value type(string)

    The adjusted string.

public interface assignment(=)

Copies a string to a traditional Fortran character(len = *) string or vice-versa.

  • private elemental subroutine string_to_char(lhs, rhs)

    Assigns a string to a character array.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(out) :: lhs

    The string to which lhs is assigned.

    type(string), intent(in) :: rhs

    The string to copy.

  • private elemental subroutine char_to_string(lhs, rhs)

    Assigns a character array to a string type.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(out) :: lhs

    The string object to which rhs is assigned.

    character(len=*), intent(in) :: rhs

    The string to copy.

public interface char

Converts a string to a Fortran character array.

  • private pure function string_convert_to_char(x) result(rst)

    Converts a string to a Fortran character array.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to convert.

    Return Value character(len=:), allocatable

    The resulting string.

public interface find

Finds the starting index of all substrings within a parent string.

  • private pure function char_find_char(str, substr) result(rst)

    Finds the starting index of all substrings within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string to search.

    character(len=*), intent(in) :: substr

    The substring to search for.

    Return Value integer(kind=int32), allocatable, dimension(:)

    An array containing the starting index of each occurrence of substr in str.

  • private pure function char_find_str(str, substr) result(rst)

    Finds the starting index of all substrings within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string to search.

    type(string), intent(in) :: substr

    The substring to search for.

    Return Value integer(kind=int32), allocatable, dimension(:)

    An array containing the starting index of each occurrence of substr in str.

  • private pure function str_find_char(str, substr) result(rst)

    Finds the starting index of all substrings within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string to search.

    character(len=*), intent(in) :: substr

    The substring to search for.

    Return Value integer(kind=int32), allocatable, dimension(:)

    An array containing the starting index of each occurrence of substr in str.

  • private pure function str_find_str(str, substr) result(rst)

    Finds the starting index of all substrings within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string to search.

    type(string), intent(in) :: substr

    The substring to search for.

    Return Value integer(kind=int32), allocatable, dimension(:)

    An array containing the starting index of each occurrence of substr in str.

public interface index

Returns the starting position of a substring within a string.

  • private pure elemental function string_index_string(str, substr, back) result(rst)

    Returns the starting position of a substring within a string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string to search.

    type(string), intent(in) :: substr

    The substring for which to search.

    logical, intent(in), optional :: back

    occurrence rather than the first; else, if true, the index is the start of the first occurrence of the substring.

    Return Value integer(kind=int32)

    The starting index of the substring.

  • private pure elemental function string_index_char(str, substr, back) result(rst)

    Returns the starting position of a substring within a string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string to search.

    character(len=*), intent(in) :: substr

    The substring for which to search.

    logical, intent(in), optional :: back

    occurrence rather than the first; else, if true, the index is the start of the first occurrence of the substring.

    Return Value integer(kind=int32)

    The starting index of the substring.

  • private pure elemental function char_index_string(str, substr, back) result(rst)

    Returns the starting position of a substring within a string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string to search.

    type(string), intent(in) :: substr

    The substring for which to search.

    logical, intent(in), optional :: back

    occurrence rather than the first; else, if true, the index is the start of the first occurrence of the substring.

    Return Value integer(kind=int32)

    The starting index of the substring.

public interface insert

Inserts a substring into another string at the specified index.

  • private pure elemental function char_insert_char(str, start, substr) result(rst)

    Inserts a substring into another string at the specified index.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string into which the substring will be inserted.

    integer(kind=int32), intent(in) :: start

    The starting index at which to insert the substring.

    character(len=*), intent(in) :: substr

    The substring to insert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function char_insert_string(str, start, substr) result(rst)

    Inserts a substring into another string at the specified index.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string into which the substring will be inserted.

    integer(kind=int32), intent(in) :: start

    The starting index at which to insert the substring.

    type(string), intent(in) :: substr

    The substring to insert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_insert_char(str, start, substr) result(rst)

    Inserts a substring into another string at the specified index.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string into which the substring will be inserted.

    integer(kind=int32), intent(in) :: start

    The starting index at which to insert the substring.

    character(len=*), intent(in) :: substr

    The substring to insert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_insert_string(str, start, substr) result(rst)

    Inserts a substring into another string at the specified index.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string into which the substring will be inserted.

    integer(kind=int32), intent(in) :: start

    The starting index at which to insert the substring.

    type(string), intent(in) :: substr

    The substring to insert.

    Return Value type(string)

    The resulting string.

public interface len

Returns the length of a string.

  • private pure function string_len(x) result(rst)

    Returns the length of a string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to interrogate.

    Return Value integer(kind=int32)

    The length of the string.

public interface len_trim

Returns the length of a string.

  • private pure function string_len_trim(x) result(rst)

    Returns the length of a string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to interrogate.

    Return Value integer(kind=int32)

    The length of the string.

public interface operator(//)

Concatenation of two strings.

  • private pure elemental function concat_strings(lhs, rhs) result(rst)

    Concatenates two strings.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: lhs

    The left-hand-side string.

    type(string), intent(in) :: rhs

    The right-hand-side string.

    Return Value type(string)

    The resulting string.

  • private pure elemental function concat_char_string(lhs, rhs) result(rst)

    Concatenates two strings.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: lhs

    The left-hand-side string.

    type(string), intent(in) :: rhs

    The right-hand-side string.

    Return Value type(string)

    The resulting string.

  • private pure elemental function concat_string_char(lhs, rhs) result(rst)

    Concatenates two strings.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: lhs

    The left-hand-side string.

    character(len=*), intent(in) :: rhs

    The right-hand-side string.

    Return Value type(string)

    The resulting string.

public interface operator(/=)

Element-wise comparison of two strings.

  • private pure elemental function string_neq_string(lhs, rhs) result(rst)

    Tests two strings for inequality.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: lhs

    The left-hand-side argument.

    type(string), intent(in) :: rhs

    The right-hand-side argument.

    Return Value logical

    True if the strings are not equal; else, false.

  • private pure elemental function char_neq_string(lhs, rhs) result(rst)

    Tests two strings for inequality.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: lhs

    The left-hand-side argument.

    type(string), intent(in) :: rhs

    The right-hand-side argument.

    Return Value logical

    True if the strings are not equal; else, false.

  • private pure elemental function string_neq_char(lhs, rhs) result(rst)

    Tests two strings for inequality.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: lhs

    The left-hand-side argument.

    character(len=*), intent(in) :: rhs

    The right-hand-side argument.

    Return Value logical

    True if the strings are not equal; else, false.

public interface operator(==)

Element-wise comparison of two strings.

  • private pure elemental function string_eq_string(lhs, rhs) result(rst)

    Tests two strings for equality.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: lhs

    The left-hand-side argument.

    type(string), intent(in) :: rhs

    The right-hand-side argument.

    Return Value logical

    True if the strings are equal; else, false.

  • private pure elemental function char_eq_string(lhs, rhs) result(rst)

    Tests two strings for equality.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: lhs

    The left-hand-side argument.

    type(string), intent(in) :: rhs

    The right-hand-side argument.

    Return Value logical

    True if the strings are equal; else, false.

  • private pure elemental function string_eq_char(lhs, rhs) result(rst)

    Tests two strings for equality.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: lhs

    The left-hand-side argument.

    character(len=*), intent(in) :: rhs

    The right-hand-side argument.

    Return Value logical

    True if the strings are equal; else, false.

public interface remove

Removes a range of characters from the string.

  • private pure elemental function remove_char(str, start, finish) result(rst)

    Removes a range of characters from the string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string on which to operate.

    integer(kind=int32), intent(in), optional :: start

    OPTIONAL: The starting index. The default is 1.

    integer(kind=int32), intent(in), optional :: finish

    OPTIONAL: The finishing index. The default is len(str)

    Return Value type(string)

    The resulting string.

  • private pure elemental function remove_string(str, start, finish) result(rst)

    Removes a range of characters from the string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string on which to operate.

    integer(kind=int32), intent(in), optional :: start

    OPTIONAL: The starting index. The default is 1.

    integer(kind=int32), intent(in), optional :: finish

    OPTIONAL: The finishing index. The default is len(str)

    Return Value type(string)

    The resulting string.

  • private pure elemental function char_remove_char(str, substr) result(rst)

    Removes the first occurrence of the specified substring from the string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string from which to remove the substring.

    character(len=*), intent(in) :: substr

    The substring to remove.

    Return Value type(string)

    The resulting string.

  • private pure elemental function char_remove_string(str, substr) result(rst)

    Removes the first occurrence of the specified substring from the string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string from which to remove the substring.

    type(string), intent(in) :: substr

    The substring to remove.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_remove_char(str, substr) result(rst)

    Removes the first occurrence of the specified substring from the string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string from which to remove the substring.

    character(len=*), intent(in) :: substr

    The substring to remove.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_remove_string(str, substr) result(rst)

    Removes the first occurrence of the specified substring from the string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string from which to remove the substring.

    type(string), intent(in) :: substr

    The substring to remove.

    Return Value type(string)

    The resulting string.

public interface replace

Replaces the substring identified by the supplied regular expression pattern with a new substring.

  • private pure elemental function char_replace_char_char(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: src

    The string on which to operate.

    character(len=*), intent(in) :: old

    The string to replace.

    character(len=*), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function char_replace_char_string(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: src

    The string on which to operate.

    character(len=*), intent(in) :: old

    The string to replace.

    type(string), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function char_replace_string_char(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: src

    The string on which to operate.

    type(string), intent(in) :: old

    The string to replace.

    character(len=*), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function char_replace_string_string(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: src

    The string on which to operate.

    type(string), intent(in) :: old

    The string to replace.

    type(string), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_replace_char_char(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: src

    The string on which to operate.

    character(len=*), intent(in) :: old

    The string to replace.

    character(len=*), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_replace_char_string(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: src

    The string on which to operate.

    character(len=*), intent(in) :: old

    The string to replace.

    type(string), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_replace_string_char(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: src

    The string on which to operate.

    type(string), intent(in) :: old

    The string to replace.

    character(len=*), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

  • private pure elemental function string_replace_string_string(src, old, substr) result(rst)

    Replaces all instances of a substring within a parent string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: src

    The string on which to operate.

    type(string), intent(in) :: old

    The string to replace.

    type(string), intent(in) :: substr

    The new substring.

    Return Value type(string)

    The resulting string.

public interface scan

Scans the string for any of the characters in the specified substring.

  • private pure elemental function string_scan_string(str, substr, back) result(rst)

    Scans the string for any of the characters in the specified substring.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string to search.

    type(string), intent(in) :: substr

    The string for which to search.

    logical, intent(in), optional :: back

    leftmost character; else, if true, the rightmost position is returned.

    Return Value integer(kind=int32)

    The index of either the leftmost or rightmost character.

  • private pure elemental function string_scan_char(str, substr, back) result(rst)

    Scans the string for any of the characters in the specified substring.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: str

    The string to search.

    character(len=*), intent(in) :: substr

    The string for which to search.

    logical, intent(in), optional :: back

    leftmost character; else, if true, the rightmost position is returned.

    Return Value integer(kind=int32)

    The index of either the leftmost or rightmost character.

  • private pure elemental function char_scan_string(str, substr, back) result(rst)

    Scans the string for any of the characters in the specified substring.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    The string to search.

    type(string), intent(in) :: substr

    The string for which to search.

    logical, intent(in), optional :: back

    leftmost character; else, if true, the rightmost position is returned.

    Return Value integer(kind=int32)

    The index of either the leftmost or rightmost character.

public interface split_string

Splits a string by the specified delimiter character.

  • private pure function split_string_char(txt, delim) result(rst)

    Splits a string by the supplied delimiter character.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: txt

    The string on which to operate.

    character(len=1), intent(in) :: delim

    The delimiter character.

    Return Value type(string), allocatable, dimension(:)

    An array containing the resulting sub-strings.

  • private pure function split_string_str(txt, delim) result(rst)

    Splits a string by the supplied delimiter character.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: txt

    The string on which to operate.

    character(len=1), intent(in) :: delim

    The delimiter character.

    Return Value type(string), allocatable, dimension(:)

    An array containing the resulting sub-strings.

public interface string_to_int

Converts a string to a 32-bit integer.

  • private pure function string_to_int_char(x) result(rst)

    Converts a string to a 32-bit integer.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: x

    The string to convert.

    Return Value integer(kind=int32)

    The resulting integer.

  • private pure function string_to_int_string(x) result(rst)

    Converts a string to a 32-bit integer.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to convert.

    Return Value integer(kind=int32)

    The resulting integer.

public interface string_to_real

Converts a string to a 64-bit real.

  • private pure function string_to_real_char(x) result(rst)

    Converts a string to a 64-bit real.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: x

    The string to convert.

    Return Value real(kind=real64)

    The resulting value.

  • private pure function string_to_real_string(x) result(rst)

    Converts a string to a 64-bit real.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to convert.

    Return Value real(kind=real64)

    The resulting value.

public interface to_c_string

Converts a Fortran string to a C-compatible, null-terminated string.

  • private pure function char_to_c_string(x) result(rst)

    Converts a Fortran string to a C-compatible, null-terminated string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: x

    The string to convert.

    Return Value character(kind=c_char, len=1), allocatable, dimension(:)

    The resulting C string.

  • private pure function string_to_c_string(x) result(rst)

    Converts a Fortran string to a C-compatible, null-terminated string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string to convert.

    Return Value character(kind=c_char, len=1), allocatable, dimension(:)

    The resulting C string.

public interface to_lower

Converts a string to all lowercase characters. Any characters that are already lowercase, a special symbol, or a numeric value are not modified.

  • private pure function to_lower_char(x) result(rst)

    Converts a string to all lowercase characters. Any characters that are already lowercase, a special symbol, or a numeric value are not modified.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: x

    The string on which to operate.

    Return Value type(string)

    The resulting string.

  • private pure elemental function to_lower_string(x) result(rst)

    Converts a string to all lowercase characters. Any characters that are already lowercase, a special symbol, or a numeric value are not modified.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string on which to operate.

    Return Value type(string)

    The resulting string.

public interface to_string

Converts an item to a string.

  • private pure elemental function char_convert_to_string(x) result(rst)

    Converts a Fortran character array to a string.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: x

    The string to convert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function int8_to_string(x) result(rst)

    Converts an 8-bit integer to a string.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int8), intent(in) :: x

    The value to convert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function int16_to_string(x) result(rst)

    Converts a 16-bit integer to a string.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int16), intent(in) :: x

    The value to convert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function int32_to_string(x) result(rst)

    Converts a 32-bit integer to a string.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: x

    The value to convert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function int64_to_string(x) result(rst)

    Converts a 64-bit integer to a string.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: x

    The value to convert.

    Return Value type(string)

    The resulting string.

  • private pure elemental function real32_to_string(x, fmt) result(rst)

    Converts a 32-bit real to a string.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real32), intent(in) :: x

    The value to convert.

    character(len=*), intent(in), optional :: fmt

    is used. If used, specify as "(G13.6)", or whatever appropriate format string is desired. Regardless, be sure to include the parenthesis.

    Return Value type(string)

    The resulting string.

  • private pure elemental function real64_to_string(x, fmt) result(rst)

    Converts a 64-bit real to a string.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: x

    The value to convert.

    character(len=*), intent(in), optional :: fmt

    is used. If used, specify as "(G13.6)", or whatever appropriate format string is desired. Regardless, be sure to include the parenthesis.

    Return Value type(string)

    The resulting string.

  • private pure elemental function real128_to_string(x, fmt) result(rst)

    Converts a 128-bit real to a string.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real128), intent(in) :: x

    The value to convert.

    character(len=*), intent(in), optional :: fmt

    is used. If used, specify as "(G13.6)", or whatever appropriate format string is desired. Regardless, be sure to include the parenthesis.

    Return Value type(string)

    The resulting string.

  • private pure function c_string_to_string(str, nchar) result(rst)

    Converts an array of C characters (C string) to a string. The C string must be null-terminated. The null-terimator character will not be included in the result.

    Arguments

    Type IntentOptional Attributes Name
    character(kind=c_char, len=1), intent(in) :: str(*)

    The C-string to convert.

    integer(kind=int32), intent(in), optional :: nchar

    conversion. The default is 2048.

    Return Value type(string)

public interface to_upper

Converts a string to all uppercase characters. Any characters that are already uppercase, a special symbol, or a numeric value are not modified.

  • private pure function to_upper_char(x) result(rst)

    Converts a string to all uppercase characters. Any characters that are already uppercase, a special symbol, or a numeric value are not modified.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: x

    The string on which to operate.

    Return Value type(string)

    The resulting string.

  • private pure elemental function to_upper_string(x) result(rst)

    Converts a string to all uppercase characters. Any characters that are already uppercase, a special symbol, or a numeric value are not modified.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string on which to operate.

    Return Value type(string)

    The resulting string.

public interface trim

Trims any trailing blanks from the end of the string.

  • private pure elemental function string_trim(x) result(rst)

    Trims any trailing blanks from the end of the string.

    Arguments

    Type IntentOptional Attributes Name
    type(string), intent(in) :: x

    The string on which to operate.

    Return Value type(string)

    The trimmed string.


Derived Types

type, public ::  string

Defines a string type.

Type-Bound Procedures

procedure , public :: get => str_get Function
procedure , public :: set => str_set Subroutine

type, public ::  string_builder

Provides a mechanism for building strings without reallocation on each addition.

Type-Bound Procedures

generic, public :: append => sb_append_char, sb_append_string
procedure , public :: initialize => sb_init Subroutine
procedure , public :: length => sb_get_length Function
procedure , public :: to_string => sb_to_string Function