Split()
Split the string into a list of parts around a separator.
also: split separate tokenize break apart delimiter explode cut into parts separate tokenize break apart cut into parts explode divide on
Basic examples (2)
# Split on the literal hyphen
? @@( Q("ONE-TWO-THREE").Split("-") )
# SplitW at every non-letter is equivalent
? @@( Q("ONE-TWO-THREE").SplitW('{ Q(@char).IsNotLetter() }') )[ "ONE", "TWO", "THREE" ] [ "ONE", "TWO", "THREE" ]
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 438_split.ring(opens in a new tab)
# SplitAtCharsW
? @@( Q("RingRingRing").SplitAtCharsW('Q(@char).IsUppercase()') )
# SplitW(:AtChars) is the same
? @@( Q("RingRingRing").SplitW(:AtChars = 'Q(@char).IsUppercase()') )[ "ing", "ing", "ing" ] [ "ing", "ing", "ing" ]
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 442_splitatcharsw.ring(opens in a new tab)
Scope (4)
o1 = new stzString("abc;123;gafsa;ykj")
# via SplitQ
? o1.SplitQ(";").NthItem(3)
# via the long natural name
? o1.NthSubstringAfterSplittingStringUsing(3, ";")gafsa gafsa
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 748_split.ring(opens in a new tab)
oAB = new stzString("ab")
big = new stzString( oAB.Repeated(1000000) )
oXC = new stzString("x,")
oCSV = new stzString( oXC.Repeated(200000) ) # 200,000 "x," pairs
# Split(',') yields 200,000 parts
? len(oCSV.Split(","))200000
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)
# SplitW at uppercase drops the R's
? @@( Q("RingRingRing").SplitW('Q(@char).IsUppercase()') )
# SplitAtW is the same
? @@( Q("RingRingRing").SplitAtW('Q(@char).IsUppercase()') )
# the :At named param is the same
? @@( Q("RingRingRing").SplitW(:At = 'Q(@char).IsUppercase()') )[ "ing", "ing", "ing" ] [ "ing", "ing", "ing" ] [ "ing", "ing", "ing" ]
run on 2026-10-02 04:24 inside the library at commit 0e72e2e2c; taken from 439_splitw.ring(opens in a new tab)
o1 = new stzString("abc" + nl + "de" + nl + "f")
# NumberOfChars counts every char incl. newlines
? o1.NumberOfChars()
# NumberOfLines is 3
? o1.NumberOfLines()
# SplitQ(NL).NumberOfItems agrees
? o1.SplitQ(nl).NumberOfItems()8 3 3
run on 2026-10-02 04:23 inside the library at commit 0e72e2e2c; taken from 232_numberofchars.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.NthSubStringAfterSplittingStringUsing · stzString.NumberOfChars · stzString.NumberOfLines · stzString.SplitAt · stzString.SplitAtCharsW
- How-to: Split a string into parts on a delimiter

