Find()
Find pcSubStr in the string: the positions of EVERY occurrence, as a list (engine-backed, codepoint-aware). (case-sensitive by default)
also: locate search for position of index of where is
also written: FindAll · FindSubString
Basic examples (2)
# FindW reports those two positions
? @@( Q("...♥...♥...").FindW('@char = "♥"') )[ 4, 8 ]
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from 149_findw.ring(opens in a new tab)
# FindW with isDigit(@char) reports the digit positions
? @@( Q("1 AA 6 B 0 CCC 6 DD 1 Z").FindW('isDigit(@char)') )[ 1, 6, 10, 16, 21 ]
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 465_findw.ring(opens in a new tab)
Scope (4)
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )1 2 [ 1, 10 ]
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 05-one-object-any-structure.en.md(opens in a new tab)
o1 = new stzString("...emm...eh..emm...eh")
? @@( o1.FindMany([ "emm", "eh" ]) )
? @@(o1.FindManyAsSections([ "emm", "eh" ]))
? @@( o1.Find([ "emm", "eh" ]) )
? @@(o1.FindAsSections([ "emm", "eh" ])) # Of FindZZ() for short[ 4, 10, 14, 20 ] [ [ 4, 6 ], [ 10, 11 ], [ 14, 16 ], [ 20, 21 ] ] [ 4, 10, 14, 20 ] [ [ 4, 6 ], [ 10, 11 ], [ 14, 16 ], [ 20, 21 ] ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 29_findmany.ring(opens in a new tab)
# FindZZ locates the section of Programming
? @@( Q("Softanza Programming by Heart").FindZZ("Programming") )
# ReplaceInSection m->M inside [10,20]
o = new stzString("Softanza Programming by Heart")
o.ReplaceInSection("m", "M", 10, 20)
? o.Content()[ [ 10, 20 ] ] Softanza PrograMMing by Heart
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from 03_findzz.ring(opens in a new tab)
oAB = new stzString("ab")
big = new stzString( oAB.Repeated(1000000) )
# NumberOfOccurrences('a') is 1,000,000 (> 65536)
? big.NumberOfOccurrences("a")
# FindAll('a') returns all 1,000,000 positions
? len(big.FindAll("a"))
# NumberOfOccurrences('ab') is 1,000,000
? big.NumberOfOccurrences("ab")1000000 1000000 1000000
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 999_engine_string_millions_narrated.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.Count · stzString.FindAsSections · stzString.FindManyAsSections · stzString.NumberOfOccurrence · stzString.ReplaceInSection
- How-to: Find where a substring occurs in a string

