Skip to content

Conversation

jmdavis
Copy link
Member

@jmdavis jmdavis commented Jun 3, 2012

replaceFirst doesn't work for string[] haystack

@ghost
Copy link

ghost commented Jun 3, 2012

Heh, that was fast. Thanks.

{
if (from.empty) return subject;
auto balance = std.algorithm.find(subject, from.save);
if (balance.empty) return subject;
auto app = appender!R1();
auto app = appender!(E[])();
app.put(subject[0 .. subject.length - balance.length]);
app.put(to.save);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So 'to' was ForwardRange all this time, nice.

@alexrp
Copy link
Contributor

alexrp commented Jun 10, 2012

Looks OK to me.

@jmdavis
Copy link
Member Author

jmdavis commented Jun 11, 2012

Merged.

jmdavis added a commit that referenced this pull request Jun 11, 2012
@jmdavis jmdavis merged commit b6ddd05 into dlang:master Jun 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants