string Derived Type

type, public :: string

Defines a string type.


Contents


Type-Bound Procedures

procedure, public :: get => str_get

  • private pure function str_get(this, i) result(rst)

    Gets the requested character from the string.

    Arguments

    Type IntentOptional Attributes Name
    class(string), intent(in) :: this

    The string object.

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

    The index of the character to retrieve.

    Return Value character(len=1)

    The requested character.

procedure, public :: set => str_set

  • private subroutine str_set(this, i, x)

    Replaces a character in the string.

    Arguments

    Type IntentOptional Attributes Name
    class(string), intent(inout) :: this

    The string object.

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

    The index of the character to replace.

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

    The character.