replace_all Interface

public interface replace_all

Replaces all the occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Version: experimental


Module Procedures

private pure function replace_all_string_string_string(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value type(string_type)

private pure function replace_all_string_string_char(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value type(string_type)

private pure function replace_all_string_char_string(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value type(string_type)

private pure function replace_all_char_string_string(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value character(len=:), allocatable

private pure function replace_all_string_char_char(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value type(string_type)

private pure function replace_all_char_string_char(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value character(len=:), allocatable

private pure function replace_all_char_char_string(string, pattern, replacement) result(res)

Replaces all occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value character(len=:), allocatable

private pure function replace_all_char_char_char(string, pattern, replacement) result(res)

Replaces all the occurrences of substring 'pattern' in the input 'string' with the replacement 'replacement' Returns a new string

Arguments

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

Return Value character(len=:), allocatable