Merge: lib/core: introduce replace_first in text/string_search
authorJean Privat <jean@pryen.org>
Tue, 6 Jun 2017 16:01:39 +0000 (12:01 -0400)
committerJean Privat <jean@pryen.org>
Tue, 6 Jun 2017 16:01:39 +0000 (12:01 -0400)
Replace the first occurrence of `pattern` with `string`

~~~nit
assert "hlelo".replace_first("le", "el") == "hello"
assert "hello".replace_first('l', "")    == "helo"
~~~

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2475


Trivial merge