m_strings Module

module~~m_strings~~UsesGraph module~m_strings m_strings module~m_parameters m_parameters module~m_parameters->module~m_strings module~variablekind variableKind module~variablekind->module~m_strings module~variablekind->module~m_parameters module~m_errors m_errors module~variablekind->module~m_errors iso_fortran_env iso_fortran_env iso_fortran_env->module~m_strings iso_fortran_env->module~variablekind iso_fortran_env->module~m_errors module~m_errors->module~m_strings
Help

Module provides string handling capabilities Replace a substring with another in a string

Used By

module~~m_strings~~UsedByGraph module~m_strings m_strings module~idynamicarray_class iDynamicArray_Class module~m_strings->module~idynamicarray_class program~scaletest_coretran scaleTest_coretran module~m_strings->program~scaletest_coretran module~prng_class Prng_Class module~m_strings->module~prng_class module~m_kdtree m_KdTree module~m_strings->module~m_kdtree module~dargdynamicarray_class dArgDynamicArray_Class module~m_strings->module~dargdynamicarray_class module~m_readline m_readline module~m_strings->module~m_readline module~m_array1d m_array1D module~m_strings->module~m_array1d module~m_random m_random module~m_strings->module~m_random module~iargdynamicarray_class iArgDynamicArray_Class module~m_strings->module~iargdynamicarray_class module~rargdynamicarray_class rArgDynamicArray_Class module~m_strings->module~rargdynamicarray_class module~stopwatch_class Stopwatch_Class module~m_strings->module~stopwatch_class module~m_fileio m_fileIO module~m_strings->module~m_fileio module~iddynamicarray_class idDynamicArray_Class module~m_strings->module~iddynamicarray_class module~m_tests m_tests module~m_strings->module~m_tests module~ddynamicarray_class dDynamicArray_Class module~m_strings->module~ddynamicarray_class module~m_debugging m_debugging module~m_strings->module~m_debugging module~rdynamicarray_class rDynamicArray_Class module~m_strings->module~rdynamicarray_class module~m_writeline m_writeline module~m_strings->module~m_writeline module~idargdynamicarray_class idArgDynamicArray_Class module~m_strings->module~idargdynamicarray_class module~idynamicarray_class->module~m_kdtree module~idynamicarray_class->module~dargdynamicarray_class module~idynamicarray_class->module~iargdynamicarray_class module~idynamicarray_class->module~rargdynamicarray_class module~idynamicarray_class->module~m_tests module~idynamicarray_class->module~idargdynamicarray_class module~prng_class->module~m_random module~prng_class->module~m_tests module~m_kdtree->program~scaletest_coretran module~m_kdtree->module~m_tests module~dargdynamicarray_class->module~m_kdtree module~dargdynamicarray_class->module~m_tests module~m_readline->program~scaletest_coretran module~m_readline->module~m_fileio module~m_array1d->program~scaletest_coretran module~m_array1d->module~m_kdtree module~m_array1d->module~m_tests module~m_maths m_maths module~m_array1d->module~m_maths module~m_random->program~scaletest_coretran module~m_random->module~m_array1d module~m_random->module~m_tests program~test_coretran test_coretran module~m_random->program~test_coretran module~iargdynamicarray_class->module~m_tests module~rargdynamicarray_class->module~m_tests module~stopwatch_class->program~scaletest_coretran module~stopwatch_class->module~m_tests module~progressbar_class ProgressBar_Class module~stopwatch_class->module~progressbar_class module~m_fileio->program~scaletest_coretran module~m_fileio->module~m_tests module~iddynamicarray_class->module~m_tests module~iddynamicarray_class->module~idargdynamicarray_class module~m_tests->program~test_coretran module~ddynamicarray_class->module~dargdynamicarray_class module~ddynamicarray_class->module~m_tests module~rdynamicarray_class->module~rargdynamicarray_class module~rdynamicarray_class->module~m_tests module~m_writeline->program~scaletest_coretran module~m_writeline->module~m_fileio module~m_writeline->module~m_tests module~idargdynamicarray_class->module~m_tests module~m_maths->program~scaletest_coretran module~m_maths->module~m_kdtree module~m_maths->module~m_tests module~progressbar_class->program~scaletest_coretran module~progressbar_class->module~m_tests
Help


Variables

TypeVisibility AttributesNameInitial
type(c_printOptions), public :: printOptions

Interfaces

public interface str

Interface to print a string representation of a number The output format options can be set using the printOptions class

  • private function str_r1(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    real(kind=r32), intent(in) :: this
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_r1D(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    real(kind=r32), intent(in) :: this(:)
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_d1(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    real(kind=r64), intent(in) :: this
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_d1D(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    real(kind=r64), intent(in) :: this(:)
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_d2D(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    real(kind=r64), intent(in) :: this(:,:)
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_i1(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    integer(kind=i32), intent(in) :: this
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_i1D(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    integer(kind=i32), intent(in) :: this(:)
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_id1(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    integer(kind=i64), intent(in) :: this
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_id1D(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    integer(kind=i64), intent(in) :: this(:)

    1D array

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

    Return Value character(len=:), allocatable

  • private function str_s1(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: this
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_s1D(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: this(:)
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable

  • private function str_1L(this, delim) result(res)

    Interfaced with str()

    Arguments

    Type IntentOptional AttributesName
    logical, intent(in) :: this
    character(len=*), intent(in), optional :: delim

    Return Value character(len=:), allocatable


Derived Types

type, public :: c_printOptions

Print options similar to numpy's print_options

Components

TypeVisibility AttributesNameInitial
integer(kind=i32), public :: precision =3

Force this precision on the written number

integer(kind=i32), public :: threshold =10

Omit the middle entries if the size is greater than threshold

integer(kind=i32), public :: edgeitems =3

Only write the first and last threshold elements from rows and/or columns

character(len=32), public :: nanstr ='nan'

Print NAN as this

character(len=32), public :: infstr ='inf'

Print infinity as this


Functions

public function hasNentries(this, N) result(yes)

Check that a string has N entries

Arguments

Type IntentOptional AttributesName
character(len=*) :: this
integer(kind=i32) :: N

Return Value logical

public function countEntries(this) result(N)

Count the number of entries in a string

Arguments

Type IntentOptional AttributesName
character(len=*) :: this

Return Value integer(kind=i32)

public function lowerCase(str) result(res)

Convert a string to lowercase

Arguments

Type IntentOptional AttributesName
character(len=*) :: str

Return Value character(len=len_trim(str))

public function upperCase(str) result(res)

Convert a string to uppercase

Arguments

Type IntentOptional AttributesName
character(len=*) :: str

Return Value character(len=len_trim(str))

public function isString(tmp1, tmp2, exact_) result(yes)

Match two string together

Arguments

Type IntentOptional AttributesName
character(len=*) :: tmp1

Compare this string

character(len=*) :: tmp2

Compare this string

logical, optional :: exact_

Optional logical, if true, the strings are not converted to lowercase before comparison

Return Value logical

public function appendString(this, that, delim_) result(res)

Append a string

Arguments

Type IntentOptional AttributesName
character(len=*) :: this

String to append to

character(len=*) :: that

String to append

character(len=*), optional :: delim_

Optional delimiter to separate the append

Return Value character(len=:), allocatable

Appended String

public function prependString(this, that, delim_) result(res)

Prepend a string

Arguments

Type IntentOptional AttributesName
character(len=*) :: this

String to prepend to

character(len=*) :: that

String to prepend

character(len=*), optional :: delim_

Optional delimiter to separate the append

Return Value character(len=:), allocatable

Prepended String

public function iachar1D(this) result(res)

Use iachar on a full string

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: this

Return Value integer(kind=i32), allocatable, (:)


Subroutines

public subroutine read1Integer(buf, N, istat)

Get a single integer from a line, returns an error code if there is more than one entry

Arguments

Type IntentOptional AttributesName
character(len=*) :: buf

String

integer(kind=i32) :: N

Single integer

integer(kind=i32) :: istat

istat > 0 if more than one entry is found

public subroutine read1Dble(iunit, this, fname, vName, istat)

Arguments

Type IntentOptional AttributesName
integer(kind=i32), intent(in) :: iunit
real(kind=r64) :: this
character(len=*) :: fname
character(len=*) :: vName
integer(kind=i32) :: istat

public subroutine compact(this)

Replace tabs and spaces with a single space str must be a variable and not an explicit 'string'. Otherwise adjustl will fail.

Arguments

Type IntentOptional AttributesName
character(len=*) :: this

public subroutine replacedelim(this, dlim, dlimr)

Replace a single character length delimiter in a string

Arguments

Type IntentOptional AttributesName
character(len=*) :: this

Replace delim_miter in this

character(len=*) :: dlim

Find this delim_miter

character(len=*) :: dlimr

Replace with this delim_miter

public subroutine readline(iUnit, line, istat)

Reads a line from a file, ignoring any comments

Arguments

Type IntentOptional AttributesName
integer(kind=i32) :: iUnit

File ID number

character(len=*) :: line

Character string to read the line into

integer(kind=i32) :: istat

Error Status

public elemental subroutine removeComments(this)

Removes the text after the ! mark in a string

Arguments

Type IntentOptional AttributesName
character(len=*), intent(inout) :: this