lean4-htt/src/Lean/DocString
Markus Himmel 167429501b
refactor: redefine String.replace (#10986)
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"`.
2025-10-29 07:48:33 +00:00
..
Add.lean chore: rename String.endPos -> String.rawEndPos (#10853) 2025-10-21 11:25:30 +00:00
Extension.lean chore: more reorganization of strings (#10928) 2025-10-23 11:56:11 +00:00
Formatter.lean refactor: rename String.split to String.splitToList (#10822) 2025-10-18 12:12:54 +00:00
Links.lean chore: move some material out of Init.Data.String.Basic (#10893) 2025-10-22 16:31:08 +00:00
Markdown.lean refactor: redefine String.replace (#10986) 2025-10-29 07:48:33 +00:00
Parser.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Syntax.lean feat: improvements to Verso docstrings (#10479) 2025-09-20 22:05:57 +00:00
Types.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00