ReplaceSubStringBoundedBy()
ReplaceSubStringBoundedBy(pcWhat, pacBounds, pcNew): replace pcWhat with pcNew only when it sits inside a bounded section. pacBounds may be ["open","close"] OR a single string used both ways. ReplaceSubStringBoundedBy(pcWhat, bounds, :With = new): replace the occurrences of pcWhat that ARE a whole bounded region's content (the same equality contract as FindSubStringBoundedBy; same-string bounds pair with the overlap walk).
Basic examples (2)
o1 = new stzString("bla bla --word-- bla bla --nword- bla --word--")
o1.ReplaceSubStringBoundedBy("word", "--", :With = "WORD")
# the method form
? o1.Content()
o2 = new stzString("bla bla --word-- bla bla --nword- bla --word--")
o2.ReplaceXT("word", :BoundedBy = "--", :With = "WORD")
# the XT form
? o2.Content()bla bla --WORD-- bla bla --nword- bla --WORD-- bla bla --WORD-- bla bla --nword- bla --WORD--
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 575_replacesubstringboundedby.ring(opens in a new tab)
o1 = new stzString("bla bla <<word>> bla bla <<word>> bla <<word>>.")
o1.ReplaceSubStringBoundedByIB("word", [ "<<", ">>" ], "WORD")
# the method form
? o1.Content()
o2 = new stzString("bla bla <<word>> bla bla <<word>> bla <<word>>.")
o2.ReplaceXT("word", :BoundedByIB = ["<<", ">>"], :With = "WORD")
# the XT form
? o2.Content()bla bla WORD bla bla WORD bla WORD. bla bla WORD bla bla WORD bla WORD.
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 576_replacesubstringboundedib.ring(opens in a new tab)
Scope (1)
o1 = new stzString("bla bla <<word>> bla bla <<noword>> bla <<word>>")
o1.ReplaceSubStringBoundedBy("noword", [ "<<", ">>" ], :With = "word")
# the method form
? o1.Content()
o2 = new stzString("bla bla <<word>> bla bla <<noword>> bla <<word>>")
o2.ReplaceXT("noword", :BoundedBy = ["<<", ">>"], :With = "word")
# the XT form
? o2.Content()bla bla <<word>> bla bla <<word>> bla <<word>> bla bla <<word>> bla bla <<word>> bla <<word>>
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 574_content.ring(opens in a new tab)
The extensions of this method
Each extension, and whether it exists for this method; an extension that exists combines with the others (FindSTCS).
Every example is a test file of the library, run inside the library for this page; only those whose output kept every promise their file wrote are shown.
See also
- The class stzString
- The area's reference: String
- The other methods in these examples: stzString.Replace

