string_module Module

Module for string manipulation.


Used by

  • module~~string_module~~UsedByGraph module~string_module string_module module~fortran_astrodynamics_toolkit fortran_astrodynamics_toolkit module~fortran_astrodynamics_toolkit->module~string_module

Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: lower = 'abcdefghijklmnopqrstuvwxyz'

lowercase characters

character(len=*), private, parameter :: upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

uppercase characters


Functions

public pure function replace_char(str, s1, s2) result(newstr)

Replace all occurrences of a single character s1 in str with s2.

Arguments

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

original string

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

find all occurrences of this character

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

replace with this character

Return Value character(len=:), allocatable

new string

public pure function lchop(str, chars) result(newstr)

Chop leading chars string from str. Note that trailing spaces are not ignored in either string.

Arguments

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

original string

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

characters to strip

Return Value character(len=:), allocatable

new string

public pure function rchop(str, chars) result(newstr)

Chop trailing chars string from str. Note that trailing spaces are not ignored in either string.

Arguments

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

original string

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

characters to strip

Return Value character(len=:), allocatable

new string

public pure function reverse(str) result(newstr)

Reverse a string.

Arguments

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

original string

Return Value character(len=:), allocatable

new string

public pure function strip(str, chars) result(newstr)

Strip all occurances of chars from the beginning and end of the string.

Arguments

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

original string

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

characters to strip

Return Value character(len=:), allocatable

new string


Subroutines

public pure subroutine uppercase(str)

Convert the string to uppercase.

Arguments

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

public pure subroutine lowercase(str)

Convert the string to lowercase.

Arguments

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