README.md in multi_string_replace-1.0.8 vs README.md in multi_string_replace-2.0.0
- old
+ new
@@ -34,19 +34,19 @@
# { 0 => [10, 44], 1 => [16] }
MultiStringReplace.replace("The quick brown fox jumps over the lazy dog brown", {'brown' => 'black', 'fox' => 'wolf'})
# The quick black wolf jumps over the lazy dog black
```
-You can also pass in a Proc, these will only get evaluated when the token is encountered.
+You can also pass in a Proc, these will only get evaluated when the token is encountered. The start and end replace position will passed to the proc.
```ruby
-MultiStringReplace.replace("The quick brown fox jumps over the lazy dog brown", {'brown' => 'black', 'fox' => ->() { "cat" }})
+MultiStringReplace.replace("The quick brown fox jumps over the lazy dog brown", {'brown' => 'black', 'fox' => ->(s, e) { "cat" }})
```
Also adds a mreplace method to String which does the same thing:
```ruby
-"The quick brown fox jumps over the lazy dog brown".mreplace({'brown' => 'black', 'fox' => ->() { "cat" }})
+"The quick brown fox jumps over the lazy dog brown".mreplace({'brown' => 'black', 'fox' => ->(_, _) { "cat" }})
```
## Performance
Performing token replacement on a 200K text file repeated 100 times