DeepReplace()
Same as DeepReplaceCS: DeepReplace: recursive replace -- walk nested lists and substitute every occurrence of pOld with pNew. The recursion enters every list sublist; non-list items are compared with Haro's = (deep-equal for lists, value-equal for scalars).
Basic examples (2)
o1 = new stzList([
"me",
"other",
[ "other", "me", [ "me" ], "other" ],
"other",
"me"
])
o1.DeepReplace("me", :By = "you")
# deepreplace example 1
? @@( o1.Content() )[ "you", "other", [ "other", "you", [ "you" ], "other" ], "other", "you" ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 119_deepreplace.ring(opens in a new tab)
o1 = new stzList([
"1",
"🌞",
"1",
[ "2", "🌞", "2", "🌞"],
"1",
[ "2", ["3", "🌞"] ]
])
? o1.DeepContains("🌞")
? @@( o1.DeepFind("🌞") )
o1.DeepReplace("🌞", :By = "♥")
? @@( o1.Content() )
o1.DeepRemove("♥")
? @@SP( o1.Content() )1 [ [ 2 ], [ 4, 2 ], [ 4, 4 ], [ 6, 2, 2 ] ] [ "1", "♥", "1", [ "2", "♥", "2", "♥" ], "1", [ "2", [ "3", "♥" ] ] ] [ "1", "1", [ "2", "2" ], "1", [ "2", [ "3" ] ] ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 106_deepcontains.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 stzList
- The area's reference: Collections & objects
- The other methods in these examples: stzList.DeepContains · stzList.DeepFind · stzList.DeepRemove

