This PR defines `String.Slice.replace` and redefines `String.replace` to use the `Slice` version. The new implementation is generic in the pattern, so it supports things like `"education".replace isVowel "☃!" = "☃!d☃!c☃!t☃!☃!n"`. Since it uses the `ForwardSearcher` infrastructure, `String` patterns are searched using KMP, unlike the previous implementation which had quadratic runtime. As a side effect, the behavior when replacing an empty string now matches that of most other programming languages, namely `"abc".replace "" "k" = "kakbkck"`. |
||
|---|---|---|
| .. | ||
| Add.lean | ||
| Extension.lean | ||
| Formatter.lean | ||
| Links.lean | ||
| Markdown.lean | ||
| Parser.lean | ||
| Syntax.lean | ||
| Types.lean | ||