stringtool_obj Derived Type

type, public :: stringtool_obj

A utility to help with parsing and reformating strings.


Type-Bound Procedures

procedure, public, nopass :: RemoveExtension => stringtool_obj_RemoveExtension

  • private pure function stringtool_obj_RemoveExtension(filename) result(val)

    Removes file extension from filename while preserving scientific notation and dots in paths.

    Arguments

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

    File name

    Return Value character(len=:), allocatable

    Returned string with extension removed

procedure, public, nopass :: RemovePath => stringtool_obj_RemovePath

  • private pure function stringtool_obj_RemovePath(filename) result(val)

    Removes path from filename.

    Arguments

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

    File name

    Return Value character(len=:), allocatable

    Returned string with path removed

Source Code

  type :: stringtool_obj
    !> A utility to help with parsing and reformating strings.
    contains
      procedure, nopass :: RemoveExtension     => stringtool_obj_RemoveExtension
      procedure, nopass :: RemovePath          => stringtool_obj_RemovePath
  end type stringtool_obj