Problem with std.algorithm.iteration::substitute

Martin Brezl martin.brzenska at googlemail.com
Sat Jan 11 18:48:46 UTC 2020


On Saturday, 11 January 2020 at 17:10:02 UTC, Martin Brezl wrote:
> Hi,
>
> i have a function like this:
> ```
>[...]
> auto result = content.substitute(searches.front,replace);
>	for(size_t i=1; i < searches.length; i++) {
>		searches.popFront();
>		result = result.substitute(searches.front,replace);
>       }
> [...]

`result = result.to!string.substitute(searches.front,replace);`

Convertring result to string solves the problem - but i do not 
understand why the Example "Multiple substitutes" from the docs 
is working.


More information about the Digitalmars-d-learn mailing list