ContainsInSection()
ContainsInSection: does pcSubStr appear within the substring bounded by positions [n1, n2] (inclusive)?
also written: ContainsBetweenPositions
Basic examples (2)
# a caret after position 2
? Q("^^♥^^").ContainsXT("^", :AfterPosition = 2)
# a caret in the 5..3 span (normalized)
? Q("^^♥^^").ContainsInSection("^", 5, 3)1 1
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from 173_containsxt.ring(opens in a new tab)
o1 = new stzString("123♥♥678♥♥1234♥♥789")
# '♥' is inside section 3..10
? o1.ContainsInSection("♥", 3, 10)
# '♥' is inside all three sections
? o1.ContainsInSections("♥", [ [3,10], [8,12], [14,19] ])1 1
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from 104_containsinsection.ring(opens in a new tab)
Scope (1)
# '♥' is in section 2..4
? Q("^^♥^^").ContainsInSection("♥", 2, 4)
# ContainsBetweenPositions agrees
? Q("^^♥^^").ContainsBetweenPositions("♥", 2, 4)
# '♥' is in section 1..3
? Q("^^♥^^").ContainsInSection("♥", 1, 3)1 1 1
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from 171_containsinsection.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.Contains · stzString.ContainsInSections

