FindNth()
Case-insensitive word-order aliases used by narrative tests. (Cannot live inside FindNthOccurrenceCS as nested defs because they take a different arity -- top-level methods instead.)
Basic examples (2)
o1 = new stzList([ "_", "_", "♥", "_", "♥", "_", "_", "♥", "_", "_" ]) ? o1.FindNth(3, "♥")
8
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 287_findnth.ring(opens in a new tab)
o1 = new stzList([ "_", "_", "A":"C", "_", "A":"C", "_", "_", "A":"C", "_", "_" ]) ? o1.FindNth(3, "A":"C")
8
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 288_findnth.ring(opens in a new tab)
Scope (5)
o1 = new stzList([ "A", "A", "A", "B", "B", "C" ]) # the 3rd A sits at 3 ? o1.FindNthCS(3, "A", FALSE)
3
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 453_findnthcs.ring(opens in a new tab)
o1 = new stzList([ 1, 2, "A":"C", 4, 5, "A":"C", 7, "A":"C"])
? o1.FindFirst("A":"C")
? o1.FindNth(2,"A":"C")
? o1.FindLast("A":"C")3 6 8
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 292_findfirst.ring(opens in a new tab)
o1 = new stzList([ "arem", "mohsen", "AREM" ])
? @@( o1.FindAll("arem") ) + NL
? o1.FindAllCS("arem", :CS = FALSE)
? o1.FindNth(2, "arem")
? o1.FindNthCS(2, "arem", :CS = FALSE)[ 1 ] 1 3 0 3
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 372_findall.ring(opens in a new tab)
aLarge = [ "A", 10, "A", "♥", 20, 1:3, "♥", "B" ] for i = 1 to 1_000_000 aLarge + i next o1 = new stzList(aLarge) # FindNth(2, '♥') reports the position of the 2nd heart ? o1.FindNth(2, "♥")
7
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 270_findnth.ring(opens in a new tab)
o1 = new stzList([ "1", "1", [ "2", "♥", "2"], "1", [ "2", ["3", "🌞"] ] , "3" ])
? o1.FindFirst("3")
? o1.FindNth(3, "1")
? o1.Contains([ "2", "♥", "2"])
? o1.DeepContains("🌞")
? o1.DeepContainsMany([ "1", "♥", "3", "🌞" ]) # Or DeepContainsThese()
? o1.DeepContainsBoth("♥", :And = "🌞")
? o1.DeepContainsOneOfThese(["_", "🌞", "0" ])
? o1.DeepContainsNOfThese(2, ["_", "🌞", "0", "♥" ])6 4 1 1 1 1 1 1
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 326_findfirst.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.Contains · stzList.DeepContains · stzList.DeepContainsBoth · stzList.DeepContainsNOfThese · stzList.DeepContainsOneOfThese · stzList.FindAll · stzList.FindFirst · stzList.FindLast

