Replaces all occurrences of substring ‘pattern’ in the input ‘string’ with the replacement ‘replacement’ Returns a new string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_type), | intent(in) | :: | string | |||
| type(string_type), | intent(in) | :: | pattern | |||
| type(string_type), | intent(in) | :: | replacement |
pure function replace_all_string_string_string(string, pattern, replacement) result(res) type(string_type), intent(in) :: string type(string_type), intent(in) :: pattern type(string_type), intent(in) :: replacement type(string_type) :: res res = string_type(replace_all(char(string), & & char(pattern), char(replacement))) end function replace_all_string_string_string