chomp Interface

public interface chomp

Remove trailing characters in set from string. If no character set is provided trailing whitespace is removed.

Version: experimental


Module Procedures

private pure function chomp_string(string) result(chomped_string)

Remove trailing characters in set from string. Default character set variant where trailing whitespace is removed.

Arguments

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

Return Value type(string_type)

private pure function chomp_char(string) result(chomped_string)

Remove trailing characters in set from string. Default character set variant where trailing whitespace is removed.

Arguments

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

Return Value character(len=:), allocatable

private pure function chomp_set_string_char(string, set) result(chomped_string)

Remove trailing characters in set from string.

Arguments

Type IntentOptional Attributes Name
type(string_type), intent(in) :: string
character(len=1), intent(in) :: set(:)

Return Value type(string_type)

private pure function chomp_set_char_char(string, set) result(chomped_string)

Remove trailing characters in set from string.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
character(len=1), intent(in) :: set(:)

Return Value character(len=:), allocatable

private pure function chomp_substring_string_string(string, substring) result(chomped_string)

Remove trailing substrings from string.

Arguments

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

Return Value type(string_type)

private pure function chomp_substring_char_string(string, substring) result(chomped_string)

Remove trailing substrings from string.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string
type(string_type), intent(in) :: substring

Return Value character(len=:), allocatable

private pure function chomp_substring_string_char(string, substring) result(chomped_string)

Remove trailing substrings from string.

Arguments

Type IntentOptional Attributes Name
type(string_type), intent(in) :: string
character(len=*), intent(in) :: substring

Return Value type(string_type)

private pure function chomp_substring_char_char(string, substring) result(chomped_string)

Remove trailing substrings from string.

Arguments

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

Return Value character(len=:), allocatable