ReplaceAt()
Positional replace: swap whatever lives at position n with pNewItem. Mirrors AddItemAt / InsertAt / RemoveAt naming.
Basic examples (2)
o1 = new stzList([ "A", "a", "A" ]) o1.ReplaceAt(2, :By = "A") ? o1.Content()
A A A
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 528_replaceat.ring(opens in a new tab)
o1 = new stzList([ "♥", 2, "♥", "♥", 5 ]) o1.ReplaceAt(2, "♥") ? @@( o1.Content() )
[ "♥", "♥", "♥", "♥", 5 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 531_replaceat.ring(opens in a new tab)
Scope (3)
o1 = new stzList([ "♥", 2, "♥", "♥", 5 ]) o1.ReplaceAt([2, 5], "♥") # Or ReplaceAnyAt() ? @@( o1.Content() ) o1.ReplaceThisAt(3, "♥", 3) ? @@( o1.Content() )
[ "♥", "♥", "♥", "♥", "♥" ] [ "♥", "♥", 3, "♥", "♥" ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 532_replaceat.ring(opens in a new tab)
o1 = new stzList([ "A", "b", "C" ]) o1.ReplaceAt(2, "B") ? o1.Content() o1 = new stzList([ "A", "b", "C" ]) o1.ReplaceAt(2, :With = "B") ? o1.Content()
A B C A B C
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 527_replaceat.ring(opens in a new tab)
o1 = new stzList([ "1", "2", "*", "4", "5" ]) o1.ReplaceAt(3, :By = "3") ? @@( o1.Content() ) o1 = new stzList([ "1", "_", "3", "_", "_" ]) o1.ReplaceNextNthOccurrenceST( 2, :Of = "_", :With = "5", :StartingAt = 3) ? @@( o1.Content() )
[ "1", "2", "3", "4", "5" ] [ "1", "_", "3", "_", "5" ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 442_replaceat.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.ReplaceNextNthOccurrence · stzList.ReplaceThisAt

