Public Member Functions | |
| recursive character(string) function | replace (str, from, to, recursive, start_pos) |
Definition at line 178 of file dc_string.f90.
| recursive character(string) function dc_string::replace::replace | ( | character(*), intent(in) | str, |
| character(*), intent(in) | from, | ||
| character(*), intent(in) | to, | ||
| logical, intent(in), optional | recursive, | ||
| integer, intent(in), optional | start_pos | ||
| ) |
Replace substring in string
If string from is included in str, replaces it with string to and returns. If from is not included, returns str without change. When multiple from are included, only the first one is replaced. To replace all from to to, give .true. to optional argument recursive. By default, the string is searched from the top. If optional argument start_pos is given, the search starts from start_pos.
| [in] | str | Source string |
| [in] | from | String to find |
| [in] | to | Replacement string |
| [in] | recursive | If .true., replace all occurrences (optional) |
| [in] | start_pos | Starting position for search (optional) |
Definition at line 1658 of file dc_string.f90.
References dc_types::sp, and dc_types::string.