Okay. I've changed it to "string".replace("find", "replace");. Does that work better for you?
I was talking about if you just want to use regular strings, the replace doesn't work as expected (replacing all strings with the replace argument).
Yes, that's certainly one way of doing it. But you'll have to sanitize the find string to make sure it doesn't accidentally do regex-type things. I'll add some tests for this.
I know its a year later but you are missing the s on your bottles
Okay. I've changed it to
"string".replace("find", "replace");
. Does that work better for you?I was talking about if you just want to use regular strings, the replace doesn't work as expected (replacing all strings with the
replace
argument).I have updated the test cases so the expected and actual output both are written in
<pre>
tags - maybe you should take a look at the whitespace.Yes, that's certainly one way of doing it. But you'll have to sanitize the
find
string to make sure it doesn't accidentally do regex-type things. I'll add some tests for this.