Softanza
StartFrançais
Softanza
The library documents itself · String

stzString

1118 own methods · 756 forms written with extensions, listed under their method

the source: base/string/stzString.ring(opens in a new tab) · All classes · The area reference: String

Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean

Examples: 220 come from the library's tests; 586 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzString("banana split"). 312 methods have none yet. Examples run on 2026-10-03 20:34 inside the library at commit 0e72e2e2c.

Method
Explanation, as the source carries it
operator
Haro's `obj[n]` syntax dispatches to operator("[]", n). For stzString we want the n-th codepoint (1-based). Negative n counts from the end: Q("ABCDE")[-1] = "E", [-2] = "D".no extension
init
Build the string object from the given Haro string.no extension
Override stzObject.Stringified/ToString. The parent returns ObjectName() (which is "@noname" for unnamed objects); stzString must return its actual content. Without this override, stzHashList.Classes() returned 4x "@noname" instead of the unique value labels. 6 examples runalso written: Text · AsWell · String · ToString · TheString · Stringified · DeepStringifiedin the section getting content of the string
o1 = new stzList([ 1, 2, 3 ])
? @@( o1 + Q(4) + 5 )
? @@( (o1 + Q("X" : "Z")).content() )
#--> [ 1, 2, 3, 4, 5 ]
#--> [ 1, 2, 3, [ "X", "Y", "Z" ] ]
library testQCSXTZZZIBWU
InfereType
Infer the canonical Softanza type named by this string. Used by the global InfereType(cType). Scalars collapse to :Number/:String/:Char (Stz-prefixed to :StzNumber/...); non-stz list/pair types collapse to the generic :List; stz-prefixed list types keep their (de-pluralised) canonical name (e.g. StzListsOfNumbers -> :StzListOfNumbers). Delegates to a file-scope helper: inside this class StartsWith / StzFind / StzReplaceCS resolve to stzString METHODS (wrong arity -> R20); at file scope they resolve to the global funcs.
composed example
o1 = new stzString("banana split")
? o1.InfereType()
#--> unknown
composed from the signature, run for this page
no extension
Show
Show -- print the content to stdout (terminated by NL). Convenience alias used by narrative tests of the form `o.Show()` instead of `? o.Content()`.QCSXTZZZIBWU
Display
Same as Show: print the content to stdout (terminated by NL). Convenience alias used by narrative tests of the form `o.Show()` instead of `? o.Content()`.no extension
Print
Same as Show: print the content to stdout (terminated by NL). Convenience alias used by narrative tests of the form `o.Show()` instead of `? o.Content()`.no extension
BoundsOf
BoundsOf(pcSub): the FLAT bound runs (left then right, per occurrence) of the occurrences bounded on BOTH sides -- per the original SubStringBoundsCS (Sections of the bound sections).QCSXTZZZIBWU
FirstBoundsOf
FirstBoundsOf / LastBoundsOf: just the left / right runs of the both-side-bounded occurrences.no extension
LastBoundsOf
(no comment in the source: the name reads as a sentence) last bounds ofin the section getting content of the stringno extension
BoundsOfFirstOccurrence
(no comment in the source: the name reads as a sentence) bounds of first occurrencein the section getting content of the stringno extension
BoundsOfUpToNChars
BoundsOfUpToNChars(pcSub, n): like BoundsOf but cap each PER-OCCURRENCE side at n chars (counted from the inside out). n can also be the list [nBefore, nAfter] for independent caps.no extension
BoundsOfXT3
(no comment in the source: the name reads as a sentence) bounds of xt3in the section getting content of the stringno extension
Engine
getting the engine handleno extension
The length of the string in characters (Unicode codepoints). 11 examples runalso named: length string length length of the string size how long count characters number of lettersalso written: Length
ostr = new stzString("s㊱m")
? ostr.NumberOfChars()
? ostr[2]
#--> 3
#--> ㊱
library testQCSXTZZZIBWU
HasMoreCharsThan
(no comment in the source: the name reads as a sentence) has more chars thanalso written: IsLarger · HasMoreChars · IsLargerThanalso accepted: HasMoreChars(3) · HasMoreChars(:Than = 3) · HasMoreChars(:Then = 3)in the section comparing size (number of chars)
composed example
o1 = new stzString("banana split")
? o1.HasMoreCharsThan(3)
#--> 1
composed from the signature, run for this page
no extension
HasLessCharsThan
(no comment in the source: the name reads as a sentence) has less chars thanalso written: IsSmaller · HasLessChars · HasFewerChars · IsSmallerThanalso accepted: HasLessChars(3) · HasLessChars(:Than = 3) · HasLessChars(:Then = 3)in the section comparing size (number of chars)
composed example
o1 = new stzString("banana split")
? o1.HasLessCharsThan(3)
#--> 0
composed from the signature, run for this page
no extension
HasSameNumberOfCharsAs
(no comment in the source: the name reads as a sentence) has same number of chars asalso written: HasAsManyCharsAsin the section comparing size (number of chars)
composed example
o1 = new stzString("banana split")
? o1.HasSameNumberOfCharsAs(3)
#--> 0
composed from the signature, run for this page
no extension
IsEmpty
Whether the string has no characters.also named: empty blank is empty no characters nothing void blank empty has nothing no characters is it empty
composed example
o1 = new stzString("banana split")
? o1.IsEmpty()
#--> 0
composed from the signature, run for this page
no extension
IsAChar
TRUE if the string is exactly one char long.also written: IsChar
composed example
o1 = new stzString("banana split")
? o1.IsChar()
#--> 0
composed from the signature, run for this page · written IsAChar() in the library today: the host language already holds IsChar(), and Haro removes the detour
no extension
getting a copy of the string object 2 examples run
o2 = new stzString("R I N G")
# Copy().ReplaceQ() returns the changed copy
? o2.Copy().ReplaceQ(" ", "-").Content()
# the original is unchanged
? o2.Content()
#--> R-I-N-G
#--> R I N G
library testno extension
Update
updating the string content
composed example
o1 = new stzString("banana split")
o1.Update("AN")
? o1.Content()
#--> AN
composed from the signature, run for this page
QCSXTZZZIBWU
updating the string content 1 examples runQCSXTZZZIBWU
updating the string content 1 examples runQCSXTZZZIBWU
UndoStack
updating the string contentno extension
NthChar
The char at position n (codepoint-aware).also written: CharAt
composed example
o1 = new stzString("banana split")
? o1.NthChar(2)
#--> a
composed from the signature, run for this page
no extension
The first char of the string (codepoint-aware). 2 examples runalso named: first character initial leading character opening charalso written: LeftChar
o1 = new stzString("ABC")
# first
? o1.FirstChar()
# last
? o1.LastChar()
#--> A
#--> C
library testQCSXTZZZIBWU
The last char of the string (codepoint-aware). 2 examples runalso named: last character final char trailing character ending charalso written: RightChar
o1 = new stzString("ABC")
# first
? o1.FirstChar()
# last
? o1.LastChar()
#--> A
#--> C
library testQCSXTZZZIBWU
The chars of the string, as a list (codepoint-aware). 3 examples runalso written: ToListOfChars
oAB  = new stzString("ab")
big  = new stzString( oAB.Repeated(1000000) )
oA = new stzString("a")
oBigA = new stzString( oA.Repeated(200000) )
# Chars() returns 200,000 single chars
? len(oBigA.Chars())
#--> 200000
library testQCSXTZZZIBWU
The Unicode NAME of each char, as a list. 2 examples run
? Q("◐◰☁").CharsNames()
#--> CIRCLE WITH LEFT HALF BLACK
#--> WHITE SQUARE WITH UPPER LEFT QUADRANT
#--> CLOUD
library testno extension
The substring from position n1 to n2 (inclusive, codepoint-aware). 19 examples runalso named: substring slice part portion extract characters between two positionsalso written: Slice
# 456
? StzStringQ("123456789").Section(4, 6)
#--> 456
library testQCSXTZZZIBWU
FirstHalf
FirstHalf / SecondHalf -- split the content in two equal halves (rounded down on odd length). FirstHalfXT returns trailing char.
composed example
o1 = new stzString("banana split")
? o1.FirstHalf()
#--> banana
composed from the signature, run for this page
QCSXTZZZIBWU
SecondHalf
The second half of the string (the longer half when the length is odd).
composed example
o1 = new stzString("banana split")
? o1.SecondHalf()
#--> split
composed from the signature, run for this page
QCSXTZZZIBWU
Halves
Halves(): return [firstHalf, secondHalf] as a list of strings.
composed example
o1 = new stzString("banana split")
? @@( o1.Halves() )
#--> [ "banana", " split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
IsCircledNumber
IsCircledNumber / IsCircledDigit -- Unicode-aware single-char predicates (Enclosed Alphanumerics block etc.).also written: IsCircledDigit
composed example
o1 = new stzString("banana split")
? o1.IsCircledNumber()
#--> 0
composed from the signature, run for this page
no extension
Replace the chars at positions n1..n2 (inclusive) with pcNewSubStr. Ported from the legacy monolithic archive (~line 84916), kept minimal: pure numeric positions only. Symbolic forms (:First/:Last) are not yet supported. 5 examples run
o1 = new stzString("123--67--")
o1.ReplaceSection(1, 3, "~")
# collapsed
? o1.Content()
#--> ~--67--
library testQCSXTZZZIBWU
Sections
The substrings at the given [start, end] sections, as a list.QCSXTZZZIBWU
AntiSections
The substrings OUTSIDE the given sections, as a list.QCSXTZZZIBWU
FindAntiSections
The substrings between the occurrences of pcSubStr, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAntiSections("an") )
#--> [ "b", "a split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindAsAntiSections
FindAsAntiSections: the complement [start, end] spans (the gaps around the occurrences), not the gap substrings.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAsAntiSections("an") )
#--> [ [ 1, 1 ], [ 6, 12 ] ]
composed from the signature, run for this page
no extension
AntiFindAsSections
AntiFindAsSections: the complement POSITION sections (the gaps between occurrences), e.g. [[1,3],[8,10]] -- not the substrings.
composed example
o1 = new stzString("banana split")
? @@( o1.AntiFindAsSections("an") )
#--> [ [ 1, 1 ], [ 6, 12 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
Range
The substring starting at nStart and spanning nRange chars (lenient).
composed example
o1 = new stzString("banana split")
? o1.Range(2, 5)
#--> anana
composed from the signature, run for this page
no extension
IsLeftToRight
TRUE if the string runs left-to-right (bidi direction).
composed example
o1 = new stzString("banana split")
? o1.IsLeftToRight()
#--> 1
composed from the signature, run for this page
no extension
Whether the string contains the given substring. 13 examples runalso named: contain contains includes has contain a word is present occurs in includes has holds is there present in does it have
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]
library testQCSXTZZZIBWU
Same as ExistsInListCS: List membership predicates: does this string appear as an item in the given list of strings? Ported from the legacy monolithic archive (~line 98300). Backs the natural-language chain "Q(str).IsOneOfThese([...])" and its aliases. 1 examples runalso written: IsOneOf · IsOneOfThe · IsOneOfThese · ExistsAsItemInList
? StzListQ([ 3, 2, 5 ]).FindFirstOccurrence("2")
? StzListQ([ 3, 2, 5 ]).FindFirstOccurrence([ 2 ])
? StzListQ([ 3, 2, 5 ]).FindFirstOccurrence( 2 )
? Q(2).IsOneOfThese([ 3, 2, 5 ])
? Q("2").IsOneOfThese([ 3, 2, 5 ])
? Q([2]).IsOneOfThese([ 3, 2, 5 ])
#--> 0
#--> 0
#--> 2
#--> 1
#--> ...
library testQCSXTZZZIBWU
The first occurrence of the substring: the position(s). 9 examples runalso written: FirstOccurrence · FindFirstSubString · FindFirstOccurrence
composed example
o1 = new stzString("banana split")
? o1.FindFirst("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWUSTD
Same as FindNextCS: FindNext: find the next occurrence of pcSubStr starting AFTER position nStart (so FindNext("x", 0) is equivalent to FindFirst). Ported from the legacy monolithic archive (~line 50328). Uses Haro's substr() with start-position support so it works for both case-sensitive and case-insensitive search without pulling in engine-level changes. 6 examples runalso written: FindNextSubString
o1 = new stzString("123456789")
# nothing at or after 10
? o1.FindNext("1", :startingAt = 10)
#--> 0
library testQCSXTZZZIBWUST
(no comment in the source: the name reads as a sentence) find next nth 2 examples runin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.FindNextNth(2, "an", 5)
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
NumbersComingAfter
Same as NumbersComingAfterCS: Numbers: extract every number literal embedded in the string as a list of strings, preserving signs and decimal points. Example: "book: 12.34, watch: -56.30, glasses: 77." -> [ "12.34", "-56.30", "77" ] Ported from the legacy monolithic archive (~line 100884) -- pure char-scan, self-contained, depends only on Chars(). Used by stzTimex.ParseDurationToMinutes() and is the #3 most-called missing method in the catalog. -- NumbersComingAfter: find every signed/decimal number literal that follows an occurrence of pcSubStr in the string. Returns a list of strings (the textual number forms incl. sign). Example: new stzString("This[@i-1] = This[@i+3]").NumbersComingAfter("@i") -> [ "-1", "+3" ] Ported from archive line 101153 but kept self-contained: manual scan instead of stzRegex + WithoutSpaces dependency. Used by stzCCode and friends.also written: NumbersAfterQCSXTZZZIBWU
NumberComingAfter
Same as NumberComingAfterCS: The FIRST number coming after the substring (NULL if none).QCSXTZZZIBWU
NumberAfter
Same as NumberComingAfterCS: The FIRST number coming after the substring (NULL if none).no extension
FirstNumberComingAfter
Same as NumberComingAfterCS: The FIRST number coming after the substring (NULL if none).no extension
ToListOfStzChars
Vowels: return the list of vowel chars in the string (ASCII a/e/i/o/u, case-insensitive). Ported from archive line 103163; self-contained byte scan. NumberOfVowels / VowelN are simple count aliases; VowelsB / HasVowels are predicates. Transform the chars of the string into a list of stzChar objects (each backed by stzStringChar via the alias).
composed example
o1 = new stzString("banana split")
? @@( o1.ToListOfStzChars() )
#--> [ @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname ]
composed from the signature, run for this page
no extension
HtmlEscaped
HtmlEscaped: escape `&`, `<`, `>`, `"`, `'` to HTML entities. Self-contained: no engine dependency, no external lookup.also written: HTMLEscape · EscapedHtmlno extension
ContainsInSection: does pcSubStr appear within the substring bounded by positions [n1, n2] (inclusive)? 3 examples runalso written: ContainsBetweenPositions
# a caret after position 2
? Q("^^♥^^").ContainsXT("^", :AfterPosition = 2)
# a caret in the 5..3 span (normalized)
? Q("^^♥^^").ContainsInSection("^", 5, 3)
#--> 1
#--> 1
library testQCSXTZZZIBWU
ReplaceInSection: replace occurrences of pSubStr within the section [n1, n2] with pNew. Polymorphic on argument order: ReplaceInSection(n1, n2, pSubStr, pNew) -- bounds first ReplaceInSection(pSubStr, pNew, n1, n2) -- substrings first 1 examples run
# 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
library testQCSXTZZZIBWU
UppercaseSubString: uppercase a section or a named substring. Accepts: - UppercaseSubString(pcSub) : every occurrence - UppercaseSubString([n1, n2]) : 1-arg list form 1 examples run
o1 = new stzString("Thank you Irwin Rodriguez!")
o1.UppercaseSubString("Irwin")
o1.AddXT( 2Hearts(), :Around = "IRWIN" )
# Irwin is uppercased and hearted
? o1.Content()
#--> Thank you ♥♥IRWIN♥♥ Rodriguez!
library testQCSXTZZZIBWU
Shorten: truncate the content to the first N chars + "..." if it's longer than N. Defaults to N = 30. The "shorten the MIDDLE" family: keep N chars from each side and join them with an ellipsis. Shorten/ShortenN mutate; Shortened/ShortenedN return. 1 examples run
composed example
o1 = new stzString("banana split")
o1.Shorten()
? o1.Content()
#--> ban...lit
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) shortened n 2 examples runin the section essential find / contains / count
# ShortenedN(2) keeps 2 each side
? Q("1234567890987654321").ShortenedN(2)
# ShortenedXT(0,2,' {...} ') mirrors and uses the ellipsis
? Q("1234567890987654321").ShortenedXT(0, 2, " {...} ")
#--> 12...21
#--> 12 {...} 21
library testno extension
(no comment in the source: the name reads as a sentence) shortened 2 examples runin the section essential find / contains / count
# Shortened() keeps 3 each side
? Q("1234567890987654321").Shortened()
# ShortenedN(5) keeps 5 each side
? Q("1234567890987654321").ShortenedN(5)
# ShortenedXT(0,3,' ... ') mirrors with a custom ellipsis
? Q("1234567890987654321").ShortenedXT(0, 3, " ... ")
#--> 123...321
#--> 12345...54321
#--> 123 ... 321
library testQCSXTZZZIBWU
ShortenedUsing(pcEllipsis): keep first+last 3 chars, glued with the ellipsis. 1 examples run
# ShortenedUsing(' {...} ') keeps 3 each side
? Q("1234567890987654321").ShortenedUsing(" {...} ")
# ShortenedNUsing(5, ' {...} ') keeps 5 each side
? Q("1234567890987654321").ShortenedNUsing(5, " {...} ")
#--> 123 {...} 321
#--> 12345 {...} 54321
library testQCSXTZZZIBWU
Boxify
Boxify: surround the content with the Softanza box -- the SAME box-drawing glyphs as tables, grids, timelines and calendars (the VISUALITY design system; never plain +/- bars). Returns the boxed string; the content-mutating form is Box()/BoxXT().
composed example
o1 = new stzString("banana split")
? o1.Boxify()
#--> ┌──────────────┐
#--> │ banana split │
#--> └──────────────┘
composed from the signature, run for this page
no extension
Vowels
(no comment in the source: the name reads as a sentence) vowelsin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? @@( o1.Vowels() )
#--> [ "a", "a", "a", "i" ]
composed from the signature, run for this page
no extension
Extend / ExtendXT: append content / pad to length / pad to position. Port from archive line 3596 (the DSL variant) plus the simpler positional cases. 6 examples run
composed example
o1 = new stzString("banana split")
o1.Extend("x")
? o1.Content()
#--> banana splitx
composed from the signature, run for this page
QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) extend with 1 examples runin the section essential find / contains / count
o1 = new stzString("ABC")
o1.ExtendWith("DE")
# the content is now ABCDE
? o1.Content()
#--> ABCDE
library testQCSXTZZZIBWU
ExtendToPosition
(no comment in the source: the name reads as a sentence) extend to positionin the section essential find / contains / countQCSXTZZZIBWU
ExtendToPositionWith
(no comment in the source: the name reads as a sentence) extend to position within the section essential find / contains / countQCSXTZZZIBWU
RandomChar
Return a random char from the string content. Uniform random choice across char positions.also written: AChar · AnyChar · ARandomCharno extension
FindNumbersAsSections
FindNumbersAsSections: for each number found in the content, return a [start, end] pair (1-based byte positions). Used by stzListRandom.RandomizeNumbers and friends.no extension
NumberOfVowels
(no comment in the source: the name reads as a sentence) number of vowelsalso written: VowelN · CountVowelsin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.NumberOfVowels()
#--> 4
composed from the signature, run for this page
no extension
VowelNB
(no comment in the source: the name reads as a sentence) vowel nbin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.VowelNB()
#--> 0
composed from the signature, run for this page
no extension
IsVowel
Returns 1 if the string is a single vowel char (case-insensitive ASCII a/e/i/o/u). Convenience predicate; callers use it as `Q(c).IsVowel()` or `Q(c).Vowel()`.also written: Vowel
composed example
o1 = new stzString("banana split")
? o1.IsVowel()
#--> 0
composed from the signature, run for this page
no extension
HasVowels
(no comment in the source: the name reads as a sentence) has vowelsalso written: ContainsVowelsin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.HasVowels()
#--> 1
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) vowels b 1 examples runin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.VowelsB()
#--> 0
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) numbers 1 examples runin the section essential find / contains / count
? rx("[0-9]+").Match("24/09/2026")
? rx("[0-9]+").MatchFirst("24/09/2026")
? @@( Q("tea 12, rice 30").Numbers() )
#--> 0
#--> 1
#--> [ "12", "30" ]
library testQCSXTZZZIBWU
SumOfNumbers
Data extraction: total amounts in an invoice/log, averages, ranges. A number = optional '-', digits, one optional '.' with more digits.
composed example
o1 = new stzString("banana split")
? o1.SumOfNumbers()
#--> 0
composed from the signature, run for this page
no extension
CountNumbers
(no comment in the source: the name reads as a sentence) count numbersin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.CountNumbers()
#--> 0
composed from the signature, run for this page
no extension
MinNumber
(no comment in the source: the name reads as a sentence) min numberin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.MinNumber()
#--> 0
composed from the signature, run for this page
no extension
MaxNumber
(no comment in the source: the name reads as a sentence) max numberin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.MaxNumber()
#--> 0
composed from the signature, run for this page
no extension
AverageOfNumbers
(no comment in the source: the name reads as a sentence) average of numbersalso written: MeanOfNumbersin the section essential find / contains / count
composed example
o1 = new stzString("banana split")
? o1.AverageOfNumbers()
#--> 0
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) number of occurrence 2 examples runin the section essential find / contains / count
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]
library testQCSXTZZZIBWU
Find pcSubStr in the string: the positions of EVERY occurrence, as a list (engine-backed, codepoint-aware). (case-sensitive by default) 6 examples runalso named: locate search for position of index of where isalso written: FindAll · FindSubString
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]
library testQCSXTZZZIBWUSTDManyExcept
FindInSection
Same as FindInSectionCS: FindInSection: find occurrences of pcSubStr restricted to the character range [n1, n2]. Returns positions in the FULL string (not relative to the section). No match -> [].also written: FindAllInSection
composed example
o1 = new stzString("banana split")
? @@( o1.FindInSection("an", 2, 5) )
#--> [ 2, 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
find all / find nth 9 examples run
composed example
o1 = new stzString("banana split")
? o1.FindNth(2, "an")
#--> 4
composed from the signature, run for this page
QCSXTZZZIBWUSTD
The last occurrence of the substring: the position(s). 9 examples run
o1 = new stzString("•♥••••♥••")
# FindLast('♥') is 7
? o1.FindLast("♥")
# FindLast('_') (absent) is 0
? o1.FindLast("_")
#--> 7
#--> 0
library testQCSXTZZZIBWUSTD
StartsWith
Whether the string starts with the given prefix.also named: starts with begins with prefix leading has prefix begins with prefix at the start opens with
composed example
o1 = new stzString("banana split")
? o1.StartsWith("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
Whether the string ends with the given suffix. 1 examples runalso named: ends with finishes with suffix trailing has suffix finishes with suffix at the end closes with
composed example
o1 = new stzString("banana split")
? o1.EndsWith("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
Predicates: does the string end with / start with a numeric character (0-9)? Ported from the legacy monolithic archive (line 100803) but kept self-contained -- no dependency on stzChar.IsANumber. Used by stzGlobal feature detection. 3 examples runalso written: EndsWithNumber · ContainsAFinalNumber · EndsWithAFinalNumber · ContainsAnEndingNumber · ContainsATrailingNumber · EndsWithATrailingNumber
composed example
o1 = new stzString("banana split")
? o1.EndsWithANumber()
#--> 0
composed from the signature, run for this page
no extension
starts with / ends with 1 examples runalso written: StartsWithNumber · StartsWithALeadingNumber
composed example
o1 = new stzString("banana split")
? o1.StartsWithANumber()
#--> 0
composed from the signature, run for this page
no extension
Uppercase
Change the string to UPPER CASE in place (mutating). For a copy, use Uppercased.
composed example
o1 = new stzString("banana split")
o1.Uppercase()
? o1.Content()
#--> BANANA SPLIT
composed from the signature, run for this page
QCSXTZZZIBWU
An UPPER CASE (all capitals) copy of the string; the original is unchanged. 3 examples runalso named: upper case capitals all caps in capitals
# lowercased
? Q("tunis").Lowercased()
# uppercased
? Q("tunis").Uppercased()
# titlecased
? Q("tunis").Titlecased()
#--> tunis
#--> TUNIS
#--> Tunis
library testno extension
Lowercase
Change the string to lower case in place (mutating). For a copy, use Lowercased.QCSXTZZZIBWU
InLowercase
Misspelled but historically-used aliasesalso written: InLowarcaseQCSXTZZZIBWU
A lower case copy of the string; the original is unchanged. 7 examples runalso named: lower case small letters in lowercase
? Q("ABC") * 3
? ( Q("ABC") * Q(3) ).StzType() + NL
? ( Q("ABC") * Q(3) ).Lowercased()
? Q("ABC") * " -> "
? ( Q("ABC") * Q(" -> ") ).Lowercased()
#--> ABCABCABC
#--> stzstring
#--> abcabcabc
#--> A -> B -> C ->
#--> ...
library testno extension
Capitalize
Capitalize the first letter in place (mutating). For a copy, use Capitalized.
composed example
o1 = new stzString("banana split")
o1.Capitalize()
? o1.Content()
#--> Banana split
composed from the signature, run for this page
QCSXTZZZIBWU
Capitalized
A copy with the first letter capitalized (title-style); original unchanged.also named: title case first letter capital sentence case proper case
composed example
o1 = new stzString("banana split")
? o1.Capitalized()
#--> Banana split
composed from the signature, run for this page
no extension
Reverse
Reverse the order of the characters in the string, in place (mutating). For a copy that leaves the original unchanged, use Reversed.
composed example
o1 = new stzString("banana split")
o1.Reverse()
? o1.Content()
#--> tilps ananab
composed from the signature, run for this page
QCSXTZZZIBWU
A copy of the string with the characters in reverse order; original unchanged. 3 examples runalso named: backwards in reverse order mirrored flipped
# digits flip
? Q("9876543210").Reversed()
#--> 0123456789
library testno extension
Replace every occurrence of a substring with another. 22 examples runalso named: replace substitute swap text find and replace change all rename substitute swap change find and replace put instead
o1 = new stzString("R I N G")
o1.Replace(" ", "-")
# Replace() mutates the object
? o1.Content()
#--> R-I-N-G
library testQCSXTZZZIBWUMany
Same as Replace: replace every occurrence of pcSubStr (mutating). 7 examples run
o1 = new stzString("one two three four")
o1.ReplaceAll("two", "---")
# two became dashes
? o1.Content()
#--> one --- three four
library testQCSXTZZZIBWUExcept
Same as ReplacedCS: A copy with every occurrence of pcSubStr replaced by pcNewSubStr; the original is unchanged. 1 examples run
? Q("tea, rice, tea").Replaced("tea", :With = "coffee")
#--> coffee, rice, coffee
library testQCSXTZZZIBWU
Remove every occurrence of pcSubStr from the string (mutating). For a copy, use Removed. 26 examples runalso named: delete erase take out strip drop
composed example
o1 = new stzString("banana split")
o1.Remove("an")
? o1.Content()
#--> ba split
composed from the signature, run for this page
QCSXTZZZIBWUMany
RemoveAll
Same as Remove: remove every occurrence of pcSubStr (mutating).also named: delete strip erase get rid of take out drop
composed example
o1 = new stzString("banana split")
o1.RemoveAll("an")
? o1.Content()
#--> ba split
composed from the signature, run for this page
QCSXTZZZIBWUExcept
ReplaceNth
(no comment in the source: the name reads as a sentence) replace nthin the section replace nth / first / last
composed example
o1 = new stzString("banana split")
o1.ReplaceNth(2, "an", "AN")
? o1.Content()
#--> banANa split
composed from the signature, run for this page
QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) replace first 2 examples runin the section replace nth / first / last
composed example
o1 = new stzString("banana split")
o1.ReplaceFirst("an", "AN")
? o1.Content()
#--> bANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceLast
(no comment in the source: the name reads as a sentence) replace lastin the section replace nth / first / last
composed example
o1 = new stzString("banana split")
o1.ReplaceLast("an", "AN")
? o1.Content()
#--> banANa split
composed from the signature, run for this page
QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) replace by many 3 examples runin the section replace nth / first / last
o1 = new stzString("--*--*--*--")
o1.ReplaceByMany("*", [ "ONE", "TWO", :And = "THREE" ])
# one word per star
? o1.Content()
#--> --ONE--TWO--THREE--
library testQCSXTZZZIBWU
ReplaceSubStringsBoundedBy(pacBounds, pcNew): replace every substring sitting BETWEEN the bounds (exclusive of the bounds themselves) with pcNew. pacBounds can be ["open", "close"] or a single string used for both ends. 1 examples run
o1 = new stzString("bla bla <<word>> bla bla <<noword>> bla <<wording>>")
o1.ReplaceSubStringsBoundedBy([ "<<", ">>" ], "wrod")
# all three regions now hold wrod
? o1.Content()
#--> bla bla <<wrod>> bla bla <<wrod>> bla <<wrod>>
library testQCSXTZZZIBWU
ReplaceSubStringBoundedBy(pcWhat, pacBounds, pcNew): replace pcWhat with pcNew only when it sits inside a bounded section. pacBounds may be ["open","close"] OR a single string used both ways. ReplaceSubStringBoundedBy(pcWhat, bounds, :With = new): replace the occurrences of pcWhat that ARE a whole bounded region's content (the same equality contract as FindSubStringBoundedBy; same-string bounds pair with the overlap walk). 3 examples runQCSXTZZZIBWU
ReplaceSubStringAtPosition
ReplaceSubStringAtPosition(n, pcOld, pcNew): replace pcOld with pcNew only at character position n (so pcOld must start at n).
composed example
o1 = new stzString("banana split")
o1.ReplaceSubStringAtPosition(2, "an", "AN")
? o1.Content()
#--> bANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceAt
ReplaceAt(n, pcOld, pcNew) -- replace pcOld at position n with pcNew ReplaceAt(anPos, pcOld, :By = pcNew) -- list-of-positions form Haro's strict arity means the single-char form lives at ReplaceCharAt(n, pcNewChar) (positional or named-param). Three-arg signature -- callers using the 2-arg form should use ReplaceCharAt.
composed example
o1 = new stzString("banana split")
o1.ReplaceAt(2, "an", "AN")
? o1.Content()
#--> bANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceCharAt(:Position = n, :By = pcNew) -- named-param variant of ReplaceAt for char-at-position replacement. 2 examples run
o1 = new stzString("ABC*EF")
o1.ReplaceCharAt(:Position = 4, :By = "D")
# the star became D
? o1.Content()
#--> ABCDEF
library testQCSXTZZZIBWU
ReplaceCharAtSimple
ReplaceCharAt(n, pcNew) -- single-char-at-position form. (Named-param :Position/:By form lives at ReplaceCharAt2 above.)
composed example
o1 = new stzString("banana split")
o1.ReplaceCharAtSimple(2, "AN")
? o1.Content()
#--> bANnana split
composed from the signature, run for this page
no extension
ReplaceCharsAtPositions(anPos, :With/:By = pcNewChar) -- replace the char at each listed position with pcNewChar. 1 examples run
o1 = new stzString("AB3CD6EF9GH")
o1.ReplaceCharsAtPositions([ 3, 9, 6 ], Heart())
# all three replaced
? o1.Content()
#--> AB♥CD♥EF♥GH
library testQCSXTZZZIBWU
ReplaceCharsAtPositionsByMany(anPos, paChars): per-position parallel replacement -- position anPos[i] gets replaced by paChars[i] (cycling if there are more positions than chars). 1 examples run
o1 = new stzString("ab3de6gh9")
o1.ReplaceCharsAtPositionsByMany([3, 6, 9], [ "c", "f", "i" ])
# the alphabet restored
? o1.Content()
#--> abcdefghi
library testQCSXTZZZIBWU
Sit
Sit(:OnSection = [n1, n2], :AndHarvest = [:NCharsBefore=a, :NCharsAfter=b]) -- "sit on a section" and harvest a chars to the left + b chars to the right of it. Returns [cLeft, cRight]. Sit(:OnSection = [n1,n2] / :OnPosition = n, :AndHarvest = [...] / :AndHarvestSections = [...]): sit on a section (or single position) and harvest what's around it. Harvest specs: :NCharsBefore / :NCharsAfter (fixed counts) and :CharsBeforeW / :CharsAfterW (the run of chars satisfying a W predicate). The Sections variant returns the [start, end] spans instead of the substrings.no extension
Markers
Markers(): return the list of marker numbers as they appear, left-to-right. e.g. "#1 #3 #2" -> [1, 3, 2].QCSXTZZZIBWU
Marquers
Marquers() returns the "#N" STRINGS (the numeric-only view stays in Markers(), which the sorting checks use).QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) number of markers 1 examples runalso written: NumberOfMarquersin the section replace nth / first / last
composed example
o1 = new stzString("banana split")
? o1.NumberOfMarkers()
#--> 0
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) markers are sorted in ascending 1 examples runalso written: MarkersAreSortedAscending · MarquersAreSortedInAscendingin the section replace nth / first / last
# 1-2-3 ascends
? Q("My name is #1, my age is #2, and my job is #3.").MarquersAreSortedInAscending()
# 2-1-3 does not
? Q("My name is #2, my age is #1, and my job is #3.").MarquersAreSortedInAscending()
#--> 1
#--> 0
library testno extension
(no comment in the source: the name reads as a sentence) markers are sorted in descending 1 examples runalso written: MarquersAreSortedInDescendingin the section replace nth / first / last
# 3-2-1 descends
? Q("My name is #3, my age is #2, and my job is #1.").MarquersAreSortedIndescending()
# 2-1-3 does not
? Q("My name is #2, my age is #1, and my job is #3.").MarquersAreSortedInDescending()
#--> 1
#--> 0
library testno extension
(no comment in the source: the name reads as a sentence) markers are sorted 2 examples runalso written: MarquersAreSortedin the section replace nth / first / last
o1 = new stzString("My name is #1, my age is #2, and my job is #3.")
# they are sorted
? o1.MarquersAreSorted()
# ... ascending
? o1.MarquersSortingOrder()
#--> 1
#--> ascending
library testno extension
MarkersAreUnsorted: TRUE when markers don't all monotone. 1 examples runalso written: MarquersAreUnsorted
o1 = new stzString("My name is #1, my age is #3, and my job is #2.")
# they are unsorted
? o1.MarquersAreUnsorted()
# the order says so
? o1.MarquersSortingOrder()
#--> 1
#--> unsorted
library testno extension
MarkersSortingOrder: :Ascending, :Descending, :Unsorted, or :Undefined for fewer than 2 markers. 3 examples runalso written: MarquersSortingOrder
o1 = new stzString("My name is #1, my age is #2, and my job is #3.")
# they are sorted
? o1.MarquersAreSorted()
# ... ascending
? o1.MarquersSortingOrder()
#--> 1
#--> ascending
library testno extension
SpacifyChars / SpacifyCharsUsing / SpacifyCharsXT -- char-wise Spacify variants: insert a separator between every pair of consecutive chars (with optional step + direction). 3 examples run
o1 = new stzString("99999999999")
o1.SpacifyChars()
# a space is inserted between every 9
? o1.Content()
#--> 9 9 9 9 9 9 9 9 9 9 9
library testQCSXTZZZIBWU
Spacify: shorter spelling -- same as SpacifyChars. 11 examples run
# four carets, doubled gaps
? Q("ABTCADNBBABEFACCC").SpacifyQ().vizFind("A")
#--> A B T C A D N B B A B E F A C C C
#--> ^-------^---------^-------^------
library testQCSXTZZZIBWU
SpacifyUsing
SpacifyUsing: alias of SpacifyCharsUsing.QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) spacify chars using 1 examples runin the section replace nth / first / last
o1 = new stzString("SOFTANZA")
o1.SpacifyCharsUsing("~")
# tilde-joined
? o1.Content()
#--> S~O~F~T~A~N~Z~A
library testQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) remove first 1 examples runin the section remove first / last
o1 = new stzString("**A1****A2***A3")
o1.RemoveFirst("A")
# the first A is gone
? o1.Content()
#--> **1****A2***A3
library testQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) remove last 2 examples runin the section remove first / last
o1 = new stzString("**A1****A2***A3")
o1.RemoveLast("A")
# the third A is gone
? o1.Content()
#--> **A1****A2***3
library testQCSXTZZZIBWU
Insert pcSubStr BEFORE position n -- or before the given anchor substring (mutating). 3 examples runalso named: put before prepend at inject ahead of
o1 = new stzString("123456789")
o1.InsertBefore([4, 7], "_")
# underscores land before positions 4 and 7
? o1.Content()
#--> 123_456_789
library testQCSXTZZZIBWU
InsertBeforePosition
Same as InsertBefore: Insert pcSubStr BEFORE position n -- or before the given anchor substring (mutating).
composed example
o1 = new stzString("banana split")
o1.InsertBeforePosition(2, "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
no extension
ExtendToWith(n, pcChar): pad the string out to total length n by appending copies of pcChar at the end. 1 examples run
o1 = new stzString("ABC")
o1.ExtendToWith(5, "*")
# 'ABC' padded to width 5 with '*'
? o1.Content()
#--> ABC**
library testQCSXTZZZIBWU
Pad the string to total length n by cycling its own chars (mutating). 1 examples run
o1 = new stzString("123")
o1.ExtendToWithCharsRepeated(8)
# '123' repeated up to width 8
? o1.Content()
#--> 12312312
library testQCSXTZZZIBWU
Pad the string to total length n by cycling the given chars or range (mutating). 1 examples run
o1 = new stzString("123")
o1.ExtendToWithCharsIn( 8, "1":"3" )
# it grows to length 8 by cycling 1,2,3
? o1.Content()
#--> 12312312
library testQCSXTZZZIBWU
RemoveCharsWXT(pcCondition): remove every char where the predicate is TRUE. Predicate runs with @char bound. 6 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveCharsW("@char = 'a'")
? o1.Content()
#--> bnn split
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveDuplicatedChars
RemoveDuplicatedChars: dedup chars in-place (keep first occurrence).
composed example
o1 = new stzString("banana split")
o1.RemoveDuplicatedChars()
? o1.Content()
#--> ban split
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveDupChars
Same as RemoveDuplicatedChars: RemoveDuplicatedChars: dedup chars in-place (keep first occurrence).
composed example
o1 = new stzString("banana split")
o1.RemoveDupChars()
? o1.Content()
#--> ban split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertAt
Same as InsertBefore: Insert pcSubStr BEFORE position n -- or before the given anchor substring (mutating).
composed example
o1 = new stzString("banana split")
o1.InsertAt(2, "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
Insert pcSubStr AFTER position n -- or after the given anchor substring (mutating). 1 examples run
composed example
o1 = new stzString("banana split")
o1.InsertAfter(2, "an")
? o1.Content()
#--> baannana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertAfterPosition
Same as InsertAfter: Insert pcSubStr AFTER position n -- or after the given anchor substring (mutating).
composed example
o1 = new stzString("banana split")
o1.InsertAfterPosition(2, "an")
? o1.Content()
#--> baannana split
composed from the signature, run for this page
no extension
InsertAfterPositions(anPos, pcStr): insert pcStr after each position in anPos. Walk descending so earlier positions stay valid as later inserts shift the string. 2 examples run
o1 = new stzString("SOFTANZA")
o1.InsertAfterPositions([ 2, 4, 6, 8 ], " ")
# pairs, no trailing space
? o1.Content()
#--> SO FT AN ZA
library testQCSXTZZZIBWU
InsertBeforePositions: mirror. Insert pcStr before EACH of the given positions (mutating). 1 examples run
o1 = new stzString("SOFTANZA")
o1.InsertBeforePositions([ 2, 4, 6, 8 ], " ")
# split look
? o1.Content()
#--> S OF TA NZ A
library testQCSXTZZZIBWU
InsertAfterEachNChars
InsertAfterEachNChars(n, pcStr) -- insert pcStr after every n characters, walking from start by default. :StartingFrom = :End walks from the right.
composed example
o1 = new stzString("banana split")
o1.InsertAfterEachNChars(2, "an")
? o1.Content()
#--> baannaannaan sanplanit
composed from the signature, run for this page
QCSXTZZZIBWU
The words of the string, as a list (whitespace-split by design). 1 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.Words() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQQ
How many words the string holds. 1 examples runalso named: word count how many words count the wordsalso written: CountWords · HowManyWords
o1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9
library testno extension
StemmedInLanguage
(no comment in the source: the name reads as a sentence) stemmed in languagein the section text-meaning domain (stztext, base/natural/)no extension
Stemmed
(no comment in the source: the name reads as a sentence) stemmedalso written: Stemin the section text-meaning domain (stztext, base/natural/)no extension
StemmedWordsInLanguage
(no comment in the source: the name reads as a sentence) stemmed words in languagein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.StemmedWordsInLanguage("en") )
#--> [ "banana", "split" ]
composed from the signature, run for this page
no extension
StemmedWords
(no comment in the source: the name reads as a sentence) stemmed wordsalso written: WordsStemmedin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.StemmedWords() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) supported stemmer languages 1 examples runin the section text-meaning domain (stztext, base/natural/)no extension
SupportedLemmaLanguages
(no comment in the source: the name reads as a sentence) supported lemma languagesin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.SupportedLemmaLanguages() )
#--> [ "english", "french", "arabic" ]
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) synonyms 1 examples runin the section text-meaning domain (stztext, base/natural/)QCSXTZZZIBWUQQ
(no comment in the source: the name reads as a sentence) hypernyms 1 examples runin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.Hypernyms() )
#--> [ "split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQQ
(no comment in the source: the name reads as a sentence) is synonym of 1 examples runin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.IsSynonymOf("an")
#--> 0
composed from the signature, run for this page
no extension
HasSynonyms
(no comment in the source: the name reads as a sentence) has synonymsin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.HasSynonyms()
#--> 0
composed from the signature, run for this page
no extension
LemmatizedInLanguage
(no comment in the source: the name reads as a sentence) lemmatized in languagein the section text-meaning domain (stztext, base/natural/)no extension
Lemmatized
(no comment in the source: the name reads as a sentence) lemmatizedalso written: Lemmain the section text-meaning domain (stztext, base/natural/)no extension
LemmatizedWordsInLanguage
(no comment in the source: the name reads as a sentence) lemmatized words in languagein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.LemmatizedWordsInLanguage("en") )
#--> [ "banana", "split" ]
composed from the signature, run for this page
no extension
LemmatizedWords
(no comment in the source: the name reads as a sentence) lemmatized wordsalso written: WordsLemmatizedin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.LemmatizedWords() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
no extension
SentimentScore
(no comment in the source: the name reads as a sentence) sentiment scorealso written: SentimentCompoundin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.SentimentScore()
#--> 0
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) sentiment 1 examples runin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.Sentiment()
#--> neutral
composed from the signature, run for this page
no extension
PositiveScore
(no comment in the source: the name reads as a sentence) positive scorein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.PositiveScore()
#--> 0
composed from the signature, run for this page
no extension
NegativeScore
(no comment in the source: the name reads as a sentence) negative scorein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.NegativeScore()
#--> 0
composed from the signature, run for this page
no extension
NeutralScore
(no comment in the source: the name reads as a sentence) neutral scorein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.NeutralScore()
#--> 1
composed from the signature, run for this page
no extension
IsPositive
(no comment in the source: the name reads as a sentence) is positivein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.IsPositive()
#--> 0
composed from the signature, run for this page
no extension
IsNegative
(no comment in the source: the name reads as a sentence) is negativein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.IsNegative()
#--> 0
composed from the signature, run for this page
no extension
POSTags
The part-of-speech tag of each word (via the text layer).also written: PartOfSpeechTags
composed example
o1 = new stzString("banana split")
? @@( o1.POSTags() )
#--> [ "NN", "NN" ]
composed from the signature, run for this page
no extension
TaggedWords
(no comment in the source: the name reads as a sentence) tagged wordsalso written: WordsWithPOSin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.TaggedWords() )
#--> [ [ "banana", "NN" ], [ "split", "NN" ] ]
composed from the signature, run for this page
no extension
NamedEntities
The named entities found in the string (via the text layer).also written: Entitiesno extension
EntitiesOfType
(no comment in the source: the name reads as a sentence) entities of typein the section text-meaning domain (stztext, base/natural/)no extension
PersonNames
(no comment in the source: the name reads as a sentence) person namesin the section text-meaning domain (stztext, base/natural/)no extension
Organizations
(no comment in the source: the name reads as a sentence) organizationsin the section text-meaning domain (stztext, base/natural/)no extension
Locations
(no comment in the source: the name reads as a sentence) locationsin the section text-meaning domain (stztext, base/natural/)no extension
ContentWords
(no comment in the source: the name reads as a sentence) content wordsalso written: Keywordsin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.ContentWords() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
no extension
WithoutStopwords
(no comment in the source: the name reads as a sentence) without stopwordsin the section text-meaning domain (stztext, base/natural/)no extension
IsStopword
(no comment in the source: the name reads as a sentence) is stopwordin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.IsStopword()
#--> 0
composed from the signature, run for this page
no extension
ReadingEase
The Flesch reading-ease score of the string (via the text layer).also written: FleschReadingEaseno extension
ReadabilityGrade
(no comment in the source: the name reads as a sentence) readability gradealso written: FleschKincaidGradein the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? o1.FleschKincaidGrade()
#--> 8.79
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) key phrases 1 examples runin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.KeyPhrases(2) )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQQ
(no comment in the source: the name reads as a sentence) top key phrase 1 examples runin the section text-meaning domain (stztext, base/natural/)no extension
(no comment in the source: the name reads as a sentence) ranked keywords 1 examples runin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.RankedKeywords(2) )
#--> [ "banana", "split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQQ
(no comment in the source: the name reads as a sentence) summary sentences 1 examples runin the section text-meaning domain (stztext, base/natural/)
composed example
o1 = new stzString("banana split")
? @@( o1.SummarySentences(2) )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQQ
(no comment in the source: the name reads as a sentence) summarized in 1 examples runalso written: Summaryin the section text-meaning domain (stztext, base/natural/)no extension
WordsForSearch
Like Words() but CJK runs become OVERLAPPING CHARACTER BIGRAMS -- the dictionary-free CJK indexing baseline (cf. Lucene CJKBigramFilter), much better recall than per-character for CJK search/matching. Non-CJK words are unchanged. (True dictionary word segmentation would be a future ICU step.)also written: SearchTokens
composed example
o1 = new stzString("banana split")
? @@( o1.WordsForSearch() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
no extension
WordsThatAre
Fluent text-meaning layer -- thin delegators to the text domain (base/natural/stzText). Canonical form is Q(str).Text().<op>(); these keep Q(str).<op>() working too.QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) nouns 1 examples runin the section linguistic query . explain . explore
composed example
o1 = new stzString("banana split")
? @@( o1.Nouns() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
ProperNouns
(no comment in the source: the name reads as a sentence) proper nounsin the section linguistic query . explain . exploreno extension
(no comment in the source: the name reads as a sentence) verbs 1 examples runin the section linguistic query . explain . exploreQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) adjectives 1 examples runin the section linguistic query . explain . exploreQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) adverbs 1 examples runin the section linguistic query . explain . exploreno extension
Pronouns
(no comment in the source: the name reads as a sentence) pronounsin the section linguistic query . explain . exploreno extension
SentencesThatAre
(no comment in the source: the name reads as a sentence) sentences that arein the section linguistic query . explain . exploreno extension
PositiveSentences
(no comment in the source: the name reads as a sentence) positive sentencesin the section linguistic query . explain . exploreno extension
NegativeSentences
(no comment in the source: the name reads as a sentence) negative sentencesin the section linguistic query . explain . exploreno extension
(no comment in the source: the name reads as a sentence) most positive sentence 1 examples runin the section linguistic query . explain . exploreno extension
(no comment in the source: the name reads as a sentence) most negative sentence 1 examples runin the section linguistic query . explain . exploreno extension
(no comment in the source: the name reads as a sentence) most similar sentence to 1 examples runin the section linguistic query . explain . exploreno extension
(no comment in the source: the name reads as a sentence) language 1 examples runalso written: DetectedLanguagein the section linguistic query . explain . explore
composed example
o1 = new stzString("banana split")
? o1.Language()
#--> unknown
composed from the signature, run for this page
no extension
AutoLemmatized
(no comment in the source: the name reads as a sentence) auto lemmatizedin the section linguistic query . explain . exploreno extension
AutoStemmed
(no comment in the source: the name reads as a sentence) auto stemmedin the section linguistic query . explain . exploreno extension
SentimentExplained
(no comment in the source: the name reads as a sentence) sentiment explainedin the section linguistic query . explain . exploreno extension
ReadabilityExplained
(no comment in the source: the name reads as a sentence) readability explainedin the section linguistic query . explain . exploreno extension
Profile
(no comment in the source: the name reads as a sentence) profilein the section linguistic query . explain . exploreno extension
(no comment in the source: the name reads as a sentence) lexical diversity 1 examples runalso written: TypeTokenRatioin the section linguistic query . explain . explore
o1 = new stzString("The cat sat on the mat in the warm sun")
# lexical diversity is distinct/total words (8 distinct / 10)
? o1.LexicalDiversity()
ac = o1.ComparedTo("The dog sat on the mat in the cold rain")
# shared content vocabulary
? @@(ac[4][2])
#--> 0.80
#--> [ "sat", "mat" ]
library testno extension
StyleProfile
(no comment in the source: the name reads as a sentence) style profilein the section linguistic query . explain . exploreno extension
InContextWithWindow
(no comment in the source: the name reads as a sentence) in context with windowin the section linguistic query . explain . exploreno extension
InContext
(no comment in the source: the name reads as a sentence) in contextalso written: Concordancein the section linguistic query . explain . exploreno extension
ComparedTo
(no comment in the source: the name reads as a sentence) compared toin the section linguistic query . explain . explore
composed example
o1 = new stzString("banana split")
? @@( o1.ComparedTo("an") )
#--> [ [ "similarity", 0 ], [ "sentiment_delta", 0 ], [ "grade_delta", 12.19 ], [ "shared_keywords", [ ] ] ]
composed from the signature, run for this page
no extension
ShowTagged
(no comment in the source: the name reads as a sentence) show taggedin the section linguistic query . explain . exploreno extension
ShowEntities
(no comment in the source: the name reads as a sentence) show entitiesin the section linguistic query . explain . exploreno extension
ShowSentiment
(no comment in the source: the name reads as a sentence) show sentimentin the section linguistic query . explain . exploreno extension
Split the string into a list of parts around a separator. 6 examples runalso named: split separate tokenize break apart delimiter explode cut into parts separate tokenize break apart cut into parts explode divide on
# 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" ]
library testQCSXTZZZIBWU
SplitToNParts
SplitToNParts: split the string into fixed-size character chunks of n characters each. The split is RIGHT-anchored (counting from the end of the string), which is the natural shape for digit grouping -- "1234567" with n=3 gives ["1", "234", "567"]. The Q form returns a stzList wrapper for fluent chaining.also written: SplitInNParts
composed example
o1 = new stzString("banana split")
? @@( o1.SplitToNParts(2) )
#--> [ "banana", " split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
A copy without leading and trailing whitespace; the original is unchanged. 2 examples runalso named: without surrounding spaces whitespace stripped without padding cleaned
o1 = new stzString("  lots   of    whitespace  ")
# edges trimmed
? o1.Trimmed()
# then squeezed and shouted
? o1.SimplifyQ().Uppercased()
#--> lots   of    whitespace
#--> LOTS OF WHITESPACE
library testno extension
TrimmedLeft
A copy with the leading spaces removed; the original is unchanged.no extension
TrimmedRight
A copy with the trailing spaces removed; the original is unchanged.no extension
The lines of the string, as a list. 1 examples runalso named: split into lines rows of text line by line
composed example
o1 = new stzString("banana split")
? @@( o1.Lines() )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQRT
How many lines the string holds. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.NumberOfLines()
#--> 1
composed from the signature, run for this page
no extension
TRUE if the string is a valid Unicode char NAME. 1 examples runalso written: IsACharName
# a digit name
? Q("DIGIT ZERO").IsCharName()
# a latin letter name
? Q("LATIN CAPITAL LETTER O").IsCharName()
# a javanese name
? Q("JAVANESE PADA PISELEH").IsCharName()
#--> 1
#--> 1
#--> 1
library testno extension
TRUE if the string is a Unicode hex form like U+0041. 2 examples runalso written: IsHexUnicode · IsAHexUnicode · IsHexUnicodeInString · RepresentsAHexUnicode · RepresentsAHexUnicodeInString
# HexPrefix() is '0x'
? HexPrefix()
# '0x066E' is a hex number
? Q( HexPrefix() + "066E").RepresentsNumberInHexForm()
# 'U+066E' is a unicode-hex number
? Q("U+066E").RepresentsNumberInUnicodeHexForm()
#--> 0x
#--> 1
#--> 1
library testno extension
Dotless / DotsRemoved: return the content with dots stripped from "i" and "j" (Unicode "Latin Letter Dotless I" / "Dotless J"). Lossy on purpose -- meant for the typographic effect, not for round-trippable encoding. Port from archive line 93405. DiacriticsRemoved: strip combining diacritic codepoints from the content. Uses NFD normalisation to decompose accented letters into base + combining marks, then drops any codepoint in the combining ranges: U+0300-U+036F Combining Diacritical Marks (Latin etc.) U+0610-U+061A Arabic U+064B-U+065F Arabic Tashkil (Fatha, Damma, ...) U+06D6-U+06ED Arabic supplementals U+0951-U+0954 Vedic / Devanagari 1 examples runalso written: WithoutDiacritics
# a French sentence loses its accents
? StzStringQ("C'était un énoncé accentuée, à vrai-dire, extrâ!").DiacriticsRemoved()
# an Arabic greeting loses its harakat
? StzStringQ("السَّلَامُ عَلَيْكُمْ").DiacriticsRemoved()
#--> C'etait un enonce accentuee, a vrai-dire, extra!
#--> السلام عليكم
library testno extension
RemoveDiacritics
Remove the diacritics (accents) in place (mutating). For a copy, use DiacriticsRemoved.QCSXTZZZIBWU
TRUE if the string contains diacritics (accents). 1 examples runalso written: HasDiacritics
composed example
o1 = new stzString("banana split")
? o1.ContainsDiacritics()
#--> 0
composed from the signature, run for this page
no extension
DotsRemoved
The string in its dotless skeleton (rasm) -- the diacritic dots removed (Arabic-aware); the original is unchanged.also written: Dotless · WithoutDots · DotsOnLettersRemoved · WithoutDotsOnLetters
composed example
o1 = new stzString("banana split")
? o1.DotsRemoved()
#--> banana splıt
composed from the signature, run for this page
no extension
NLeftChars
The n leftmost chars, as a string (direction-aware).also written: NLeftCharsAsString
composed example
o1 = new stzString("banana split")
? o1.NLeftChars(2)
#--> ba
composed from the signature, run for this page
QCSXTZZZIBWU
NRightChars
The n rightmost chars, as a string (direction-aware).also written: NRightCharsAsString
composed example
o1 = new stzString("banana split")
? o1.NRightChars(2)
#--> it
composed from the signature, run for this page
QCSXTZZZIBWU
NFirstChars
The first n chars of the string.
composed example
o1 = new stzString("banana split")
? o1.NFirstChars(2)
#--> ba
composed from the signature, run for this page
QCSXTZZZIBWU
The last n chars of the string. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.NLastChars(2)
#--> it
composed from the signature, run for this page
QCSXTZZZIBWU
Remove the chars at positions n1..n2 (mutating). 1 examples run
o1 = new stzString("ABC456DE")
o1.RemoveSection(4, 6)
# the digits vanish
? o1.Content()
#--> ABCDE
library testQCSXTZZZIBWU
Remove the chars of each given [start, end] section (mutating). 2 examples run
o1 = new stzString("1♥♥456♥♥901♥♥4")
o1.RemoveSections([ 2:3, 7:8, 12:13 ])
# the three heart pairs are gone
? o1.Content()
#--> 14569014
library testno extension
ReplaceSections
Replace each given [start, end] section with pcNewSubStr (mutating).no extension
ReplaceSectionsByMany(aSections, paReplacements): replace each [n1, n2] section in aSections with the corresponding replacement from paReplacements. Walks sections in reverse so earlier positions stay valid as later ones shift. 7 examples run
o1 = new stzString("123---78--")
o1.ReplaceSectionsByMany([ [1, 3], [7, 8] ], [ "*", "~" ])
# shrunk
? o1.Content()
#--> *---~--
library testQCSXTZZZIBWU
Remove the leading spaces in place (mutating). For a copy, use TrimmedLeft. 2 examples runalso named: strip leading spaces remove left whitespaceno extension
Remove the trailing spaces in place (mutating). For a copy, use TrimmedRight. 2 examples runno extension
TrimStart
Same as TrimLeft: Remove the leading spaces in place (mutating). For a copy, use TrimmedLeft.no extension
TrimEnd
Same as TrimRight: Remove the trailing spaces in place (mutating). For a copy, use TrimmedRight.no extension
RemoveThisCharFromStart
Same as RemoveThisCharFromStartXT: RemoveThisCharFromStart / Left / End / Right -- strip every leading (or trailing) occurrence of pcChar. No-op if the string doesn't start (or end) with pcChar.QCSXTZZZIBWU
RemoveThisCharFromLeft
Same as RemoveThisCharFromStartXT: RemoveThisCharFromStart / Left / End / Right -- strip every leading (or trailing) occurrence of pcChar. No-op if the string doesn't start (or end) with pcChar.QCSXTZZZIBWU
RemoveThisCharFromEnd
Same as RemoveThisCharFromEndXT: Drop the trailing run of pcChar from the end of the string (mutating).QCSXTZZZIBWU
Same as RemoveThisCharFromEndXT: Drop the trailing run of pcChar from the end of the string (mutating). 1 examples run
o1 = new stzString("12.58000")
o1.RemoveThisCharFromRightXT("0")
# the trailing zeros are gone
? o1.Content()
#--> 12.58
library testQCSXTZZZIBWU
ReplaceLeadingChars(:With = pcNew) -- collapse the leading run of a single repeated char into one instance of pcNew. Examples: "___VAR---" + :With="*" -> "*VAR---" "aaaaHELLO" + :With="A" -> "AHELLO" If there's no run (the first 2 chars differ), the string is returned unchanged. 3 examples runQCSXTZZZIBWU
Replace the run of identical chars at the end of the string with the given string (mutating). 3 examples runQCSXTZZZIBWU
Same as ReplaceLeadingChars: ReplaceLeadingChars(:With = pcNew) -- collapse the leading run of a single repeated char into one instance of pcNew. Examples: "___VAR---" + :With="*" -> "*VAR---" "aaaaHELLO" + :With="A" -> "AHELLO" If there's no run (the first 2 chars differ), the string is returned unchanged. 1 examples runQCSXTZZZIBWU
ReplaceLeadingChar(pcChar, :With = pcNew) -- replace the leading run only IF the leading char equals pcChar. Otherwise no-op. 3 examples runQCSXTZZZIBWU
Replace the trailing run of pcChar with the given string (mutating). 2 examples runno extension
Remove leading and trailing whitespace in place (mutating). For a copy, use Trimmed. 1 examples run
o1 = new stzString(" ♥♥♥123♥♥♥   ")
o1.Trim()
# only the spaces went
? o1.Content()
#--> ♥♥♥123♥♥♥
library testQCSXTZZZIBWU
ContainsDuplicates
Same as ContainsDuplicatesCS: Same as ContainsDuplicatedSubStringsCS: TRUE if some substring occurs more than once in the string.
composed example
o1 = new stzString("banana split")
? o1.ContainsDuplicates()
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsDuplicatedSubStrings
Same as ContainsDuplicatedSubStringsCS: TRUE if some substring occurs more than once in the string.
composed example
o1 = new stzString("banana split")
? o1.ContainsDuplicatedSubStrings()
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
DuplicatedSubStrings
Same as DuplicatedSubStringsCS: The substrings that occur more than once in the string.
composed example
o1 = new stzString("banana split")
? @@( o1.DuplicatedSubStrings() )
#--> [ "a", "n" ]
composed from the signature, run for this page
QCSXTZZZIBWU
NumberOfDuplicates
Same as NumberOfDuplicatesCS: How many duplicated occurrences the string holds.
composed example
o1 = new stzString("banana split")
? o1.NumberOfDuplicates()
#--> 4
composed from the signature, run for this page
QCSXTZZZIBWU
HasDuplicatedChars
TRUE if some char occurs more than once.
composed example
o1 = new stzString("banana split")
? o1.HasDuplicatedChars()
#--> 1
composed from the signature, run for this page
no extension
UpTo
For a single-char string: the chars from it UP TO the given char, as a list.no extension
DownTo
For a single-char string: the chars from it DOWN TO the given char, as a list.no extension
Box
Surround the content with the Softanza box in place (mutating). For a copy, use Boxed.QCSXTZZZIBWU
BoxRound
Box the content with rounded corners in place (mutating).no extension
BoxifyRound
Same as BoxRound: Box the content with rounded corners in place (mutating).QCSXTZZZIBWU
A boxed copy of the string; the original is unchanged. 4 examples run
composed example
o1 = new stzString("banana split")
? o1.Boxed()
#--> ┌──────────────┐
#--> │ banana split │
#--> └──────────────┘
composed from the signature, run for this page
QCSXTZZZIBWU
BoxedRound
A rounded-corner boxed copy of the string.also written: BoxedDashed · BoxedRounded
composed example
o1 = new stzString("banana split")
? o1.BoxedRound()
#--> ╭──────────────╮
#--> │ banana split │
#--> ╰──────────────╯
composed from the signature, run for this page
no extension
BoxedRoundedDashed
A rounded, dashed-line boxed copy of the string.also written: BoxedRoundDashed
composed example
o1 = new stzString("banana split")
? o1.BoxedRoundedDashed()
#--> ╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
#--> ┊ banana split ┊
#--> ╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
composed from the signature, run for this page
no extension
EachCharBoxed
Each char in its own box cell, as a string.also written: EachCharBoxed_alias
composed example
o1 = new stzString("banana split")
? o1.EachCharBoxed()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ b │ a │ n │ a │ n │ a │   │ s │ p │ l │ i │ t │
#--> └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
composed from the signature, run for this page
QCSXTZZZIBWU
BoxRoundEachChar
BoxRoundEachChar: surround each char with a rounded-corner box.QCSXTZZZIBWU
SplitAroundPosition
SplitAroundPosition(n): two pieces around codepoint position n.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAroundPosition(2) )
#--> [ "b", "nana split" ]
composed from the signature, run for this page
no extension
TheseCharsZ
TheseCharsZ([chars]): each char grouped with ALL its positions -- [ [c, [positions]], ... ].
composed example
o1 = new stzString("banana split")
? @@( o1.TheseCharsZ([ "an", "a" ]) )
#--> [ [ "an", [ 2, 4 ] ], [ "a", [ 2, 4, 6 ] ] ]
composed from the signature, run for this page
no extension
AlignXT
Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).QCSXTZZZIBWU
UniqueChars
Same as CharsU: The UNIQUE chars of the string, in first-seen order.
composed example
o1 = new stzString("banana split")
? @@( o1.UniqueChars() )
#--> [ "b", "a", "n", " ", "s", "p", "l", "i", "t" ]
composed from the signature, run for this page
no extension
The codepoint of a single-char string -- or the codepoints list for a longer one. 1 examples run
# 'I' is codepoint 73
? Q("I").Unicode()
#--> 73
library testno extension
CharName / CharacterName / UnicodeName -- when the string IS a single character, return its Unicode name (CHECK MARK etc.). Convenient on Q("✓") narratives that avoid the StzCharQ() ramp. Haro chained-new+method parses oddly here, so split into two. 2 examples runalso written: UnicodeName · CharacterNameno extension
Unicodes
The codepoint of each char, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.Unicodes() )
#--> [ 98, 97, 110, 97, 110, 97, 32, 115, 112, 108, 105, 116 ]
composed from the signature, run for this page
QCSXTZZZIBWU
CharsAndUnicodes
Each char paired with its codepoint: [ [char, unicode], ... ].also written: UnicodePerChar
composed example
o1 = new stzString("banana split")
? @@( o1.CharsAndUnicodes() )
#--> [ [ "b", 98 ], [ "a", 97 ], [ "n", 110 ], [ "a", 97 ], [ "n", 110 ], [ "a", 97 ], [ " ", 32 ], [ "s", 115 ], [ "p", 112 ], [ "l", 108 ], [ "i", 105 ], [ "t", 116 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
UniqueCharsAndUnicodes
Same as CharsAndUnicodesU: The unique chars paired with their codepoints.
composed example
o1 = new stzString("banana split")
? @@( o1.UniqueCharsAndUnicodes() )
#--> [ [ "b", 98 ], [ "a", 97 ], [ "n", 110 ], [ " ", 32 ], [ "s", 115 ], [ "p", 112 ], [ "l", 108 ], [ "i", 105 ], [ "t", 116 ] ]
composed from the signature, run for this page
no extension
The string repeated n times. 1 examples runalso named: repeat duplicate times concatenate copies tile duplicate repeat n times multiply the string echoalso written: RepeatedNTimes
composed example
o1 = new stzString("banana split")
? o1.Repeated(2)
#--> banana splitbanana split
composed from the signature, run for this page
no extension
Repeat
Turn the content into itself repeated n times (mutating). For a copy, use Repeated.
composed example
o1 = new stzString("banana split")
o1.Repeat(2)
? o1.Content()
#--> banana splitbanana split
composed from the signature, run for this page
QCSXTZZZIBWU
Concatenate
Append the given string at the end (mutating). For a copy, use Concatenated.QCSXTZZZIBWU
Append
Same as Concatenate: Append the given string at the end (mutating). For a copy, use Concatenated.also named: add to the end concatenate tack on put after join to
composed example
o1 = new stzString("banana split")
o1.Append("an")
? o1.Content()
#--> banana splitan
composed from the signature, run for this page
QCSXTZZZIBWU
Concatenated
The string with pcStr appended, as data; the original is unchanged.
composed example
o1 = new stzString("banana split")
? o1.Concatenated("an")
#--> banana splitan
composed from the signature, run for this page
no extension
TRUE if the content equals the given string (case-sensitive). 6 examples run
composed example
o1 = new stzString("banana split")
? o1.IsEqualTo("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
IsStrictlyEqualTo
Strict equality: same content AND same Haro type (string). When the other side is a list/number, returns 0. Used by stzHashList.KeysForValue to compare values polymorphically.
composed example
o1 = new stzString("banana split")
? o1.IsStrictlyEqualTo(3)
#--> 0
composed from the signature, run for this page
no extension
RemoveFirstCharCS(pCaseSensitive): "permissiveness" form -- accepts the case-sensitivity flag for narrative-symmetry, but ignores it (per stzStringTest block #37). (case-sensitive by default) 2 examples run
o1 = new stzString("1BATISTA")
o1.RemoveFirstChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("1BATISTA").FirstCharRemoved()
#--> BATISTA
#--> BATISTA
library testQCSXTZZZIBWU
RemoveLeadingChars
RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.
composed example
o1 = new stzString("banana split")
o1.RemoveLeadingChars()
? o1.Content()
#--> anana split
composed from the signature, run for this page
QCSXTZZZIBWU
LeadingCharsAsString
LeadingChars() / TrailingChars() -- return the leading (or trailing) RUN of identical chars as a single string. e.g. "----Haro" -> "----". Used by narrative leading-char analysis. LeadingChars() returns the leading run as a LIST of chars (e.g. ["-","-","-"]); LeadingCharsAsString() returns the run "---".also written: LeadingSubString · LeadingCharsAsSubStringQCSXTZZZIBWU
The run of identical chars at the START of the string, as a list of chars. 1 examples runQCSXTZZZIBWU
The leading char (case-dial form). (case-sensitive by default) 1 examples run
o1 = new stzString("000122.12")
# the leading char
? o1.LeadingChar()
o1.RemoveThisLeadingChar("0")
# the run is gone
? o1.Content()
#--> 0
#--> 122.12
library testQCSXTZZZIBWU
NumberOfLeadingChars
Same as NumberOfLeadingItems: How long the leading char run is. (case-sensitive by default)
composed example
o1 = new stzString("banana split")
? o1.NumberOfLeadingChars()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
TrailingCharsAsString
The run of identical chars at the end of the string, as a string.also written: TrailingSubStringQCSXTZZZIBWU
TrailingChars
The run of identical chars at the END of the string, as a list of chars.QCSXTZZZIBWU
The trailing char (case-dial form). (case-sensitive by default) 2 examples runQCSXTZZZIBWU
NumberOfTrailingChars
Same as NumberOfTrailingItems: How long the trailing char run is. (case-sensitive by default)
composed example
o1 = new stzString("banana split")
? o1.NumberOfTrailingChars()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveLeadingChar
Singular forms: RemoveLeadingChar = remove ONE leading char, RemoveAnyLeadingChar = peel every leading char of the same type.
composed example
o1 = new stzString("banana split")
o1.RemoveLeadingChar()
? o1.Content()
#--> anana split
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveAnyLeadingChar
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.
composed example
o1 = new stzString("banana split")
o1.RemoveAnyLeadingChar()
? o1.Content()
#--> anana split
composed from the signature, run for this page
no extension
RemoveTrailingChar
Drop the LAST char of the string (one char, from the end) -- mutating.
composed example
o1 = new stzString("banana split")
o1.RemoveTrailingChar()
? o1.Content()
#--> banana spli
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveTrailingChars
Drop the whole trailing run of the string's last char (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveTrailingChars()
? o1.Content()
#--> banana spli
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveBoundingChars
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.
composed example
o1 = new stzString("banana split")
o1.RemoveBoundingChars()
? o1.Content()
#--> anana spli
composed from the signature, run for this page
QCSXTZZZIBWU
Immutable / past-tense forms: return the modified content without mutating This. Used by stzNumber.Absolute() and similar fluent chains. 1 examples run
o1 = new stzString("1BATISTA")
o1.RemoveFirstChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("1BATISTA").FirstCharRemoved()
#--> BATISTA
#--> BATISTA
library testno extension
A copy with the last char removed; the original is unchanged. 1 examples run
o1 = new stzString("BATISTA1")
o1.RemoveLastChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA1").LastCharRemoved()
#--> BATISTA
#--> BATISTA
library testno extension
Remove the last char of the string (mutating). 1 examples run
o1 = new stzString("BATISTA1")
o1.RemoveLastChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA1").LastCharRemoved()
#--> BATISTA
#--> BATISTA
library testQCSXTZZZIBWU
Same as RemoveFirstChar: RemoveFirstCharCS(pCaseSensitive): "permissiveness" form -- accepts the case-sensitivity flag for narrative-symmetry, but ignores it (per stzStringTest block #37). (case-sensitive by default) 1 examples run
# removing the first and last chars leaves the inner content
o = new stzString('[ @$2{"a";1;[1]}U ]')
o.RemoveFirstAndLastChars()
? o.Content()
#-->  @$2{"a";1;[1]}U
library testQCSXTZZZIBWU
Conditional first/last char removers: act only if the first (resp. last) char equals pcChar. Used by code-string fluent chains that may or may not see leading/trailing braces. 2 examples run
o1 = new stzString("{abc}")
o1.RemoveThisFirstChar("{")
o1.RemoveThisLastChar("}")
# both braces gone
? o1.Content()
#--> abc
library testQCSXTZZZIBWU
Remove the last char when it equals pcChar (mutating). 1 examples run
o1 = new stzString("{abc}")
o1.RemoveThisFirstChar("{")
o1.RemoveThisLastChar("}")
# both braces gone
? o1.Content()
#--> abc
library testQCSXTZZZIBWU
The raw bytes of the string, as a list. 1 examples run
o1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]
library testno extension
BytesPerChar
The bytes of each char, char by char.
composed example
o1 = new stzString("banana split")
? @@( o1.BytesPerChar() )
#--> [ [ "b", [ "b" ] ], [ "a", [ "a" ] ], [ "n", [ "n" ] ], [ "a", [ "a" ] ], [ "n", [ "n" ] ], [ "a", [ "a" ] ], [ " ", [ " " ] ], [ "s", [ "s" ] ], [ "p", [ "p" ] ], [ "l", [ "l" ] ], [ "i", [ "i" ] ], [ "t", [ "t" ] ] ]
composed from the signature, run for this page
no extension
How many bytes each char occupies (UTF-8), as a list. 1 examples run
o1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]
library testno extension
The size of the string in bytes (UTF-8). 1 examples run
o1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]
library testno extension
Bytecodes
The numeric byte codes of the string, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.Bytecodes() )
#--> [ 98, 97, 110, 97, 110, 97, 32, 115, 112, 108, 105, 116 ]
composed from the signature, run for this page
no extension
BytecodesPerChar
The byte codes of each char, char by char.
composed example
o1 = new stzString("banana split")
? @@( o1.BytecodesPerChar() )
#--> [ [ "b", [ 98 ] ], [ "a", [ 97 ] ], [ "n", [ 110 ] ], [ "a", [ 97 ] ], [ "n", [ 110 ] ], [ "a", [ 97 ] ], [ " ", [ 32 ] ], [ "s", [ 115 ] ], [ "p", [ 112 ] ], [ "l", [ 108 ] ], [ "i", [ 105 ] ], [ "t", [ 116 ] ] ]
composed from the signature, run for this page
no extension
SizeInBytesPerChar
How many bytes each char occupies (UTF-8), as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.SizeInBytesPerChar() )
#--> [ [ "b", 1 ], [ "a", 1 ], [ "n", 1 ], [ "a", 1 ], [ "n", 1 ], [ "a", 1 ], [ " ", 1 ], [ "s", 1 ], [ "p", 1 ], [ "l", 1 ], [ "i", 1 ], [ "t", 1 ] ]
composed from the signature, run for this page
no extension
The size of the string in bytes (UTF-8). 3 examples run
o1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]
library testno extension
Same as ContainsOneOfTheseCS: TRUE if the string contains at least ONE of the given substrings. 2 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsOneOfThese([ "an", "a" ])
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsEither(arg1, arg2): two-arg form covers the narrative shapes. arg2 can be the :Or = "..." named-param, or any string (treated as the second alternative); if arg1 is itself a list of substrings and arg2 is "", we fall back to ContainsOneOfThese. 1 examples run
# both words present is still TRUE (inclusive)
? Q("me you all the others").ContainsEither("me", :Or = "you")
# only one word present is TRUE
? Q("me and all the others").ContainsEither("me", :Or = "you")
#--> 1
#--> 1
library testno extension
Same as FindTheseBoundsCS: Find the given opening and closing bounds: their positions in the string. 1 examples run
# FindTheseBounds reports the outer [ ] positions
? @@( Q('[ @$2{"a";1;[1]}U ]').FindTheseBounds("[", "]") )
# RemoveTheseBounds drops the outer bounds
o = new stzString('[ @$2{"a";1;[1]}U ]')
o.RemoveTheseBounds("[", "]")
? o.Content()
#--> [ 1, 15 ]
#-->  @$2{"a";1;[1}U ]
library testQCSXTZZZIBWU
Remove the given opening and closing bounds when they enclose the string (mutating). 2 examples run
o1 = new stzString("<<word>>")
# it is angle-bounded
? o1.IsBoundedBy(["<<", ">>"])
o1.RemoveTheseBounds("<<",">>")
# stripped
? o1.Content()
#--> 1
#--> word
library testQCSXTZZZIBWU
Single-bound forms: same character on both sides. E.g. RemoveBounds('"') strips matching leading + trailing quotes. RemoveBounds(): no-arg, AUTO-detects the bounds and removes them in place (the mutating active form of BoundsRemoved). Matches the original. 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveBounds()
? o1.Content()
#--> anana spli
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveThisBound
RemoveThisBound(c): remove a specific same-char bound from both ends.
composed example
o1 = new stzString("banana split")
o1.RemoveThisBound("an")
? o1.Content()
#--> ba split
composed from the signature, run for this page
QCSXTZZZIBWU
Same as BetweenCS: Between() returns ALL substrings between bounds (Softanza Universal Naming Convention) FirstBetween/LastBetween/NthBetween for specific occurrences Between: the GREEDY single span between the FIRST open and the LAST close (matches the original Softanza Between -- returns a STRING, not a list). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.Between(TRUE, TRUE)
#--> ba
composed from the signature, run for this page
QCSXTZZZIBWU
Same as BoundedByCS: BoundedBy: same semantics as Between() (returns the list of substrings sitting between matched open/close delimiters) but takes the bounds packed as a 2-list [ open, close ]. Matches the archive API at line 34272 + 34290. Used by ccode tests that read like `o1.BoundedBy([ "[", "]" ])`. 3 examples runalso written: SubStringsBoundedBy · AnySubStringsBoundedBy
o1 = new stzString("blabla bla <<word1>> bla bla <<word2>>")
? o1.SubstringsBoundedBy([ "<<", ">>" ])
#--> word1
#--> word2
library testQCSXTZZZIBWU
AnyBoundedBy
AnyBoundedBy: the bounded SUBSTRINGS, derived from FindAnyBoundedByZZ so a repeated single bound ("*") keeps every overlapping region (BoundedBy's non-overlapping pairing drops the middles). AnyBoundedByZZ pairs each substring with its [start, end] span.QCSXTZZZIBWU
ContainsSubStringsBoundedBy
TRUE if some substring is bounded by the given bounds. (case-sensitive by default)also written: ContainsBoundedBy · ContainsAnyBoundedBy
composed example
o1 = new stzString("banana split")
? o1.ContainsSubStringsBoundedBy([ "an", "a" ])
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
FirstBetween
Same as FirstBetweenCS: first between (single result)QCSXTZZZIBWU
LastBetween
Same as LastBetweenCS: last between (single result)QCSXTZZZIBWU
NthBetween
Same as NthBetweenCS: nth between (single result)QCSXTZZZIBWU
ReplaceBetween
Engine replaces INCLUDING bounds. For default (bounds preserved), we wrap replacement with pcOpen + replacement + pcClose. IB variants pass replacement directly (engine includes bounds).
composed example
o1 = new stzString("banana split")
o1.ReplaceBetween("an", "an", "AN")
? o1.Content()
#--> banANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceFirstBetween
Replace what lies between the FIRST pcOpen...pcClose pair (the bounds stay) -- engine-backed, mutating.
composed example
o1 = new stzString("banana split")
o1.ReplaceFirstBetween("an", "an", "AN")
? o1.Content()
#--> banANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceLastBetween
Replace what lies between the LAST pcOpen...pcClose pair (the bounds stay) -- mutating.
composed example
o1 = new stzString("banana split")
o1.ReplaceLastBetween("an", "an", "AN")
? o1.Content()
#--> banANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceNthBetween
Replace what lies between the NTH pcOpen...pcClose pair (the bounds stay) -- mutating.QCSXTZZZIBWU
Remove what lies between every pcOpen...pcClose pair (the bounds stay) -- mutating. 2 examples run
o1 = new stzString("__/♥\__")
o1.RemoveBetween("/", "\")
# the heart between / and \\ is gone, bounds kept
? o1.Content()
#--> __/\__
library testQCSXTZZZIBWU
RemoveFirstBetween
Remove what lies between the FIRST pair only (the bounds stay) -- mutating.QCSXTZZZIBWU
RemoveLastBetween
Remove what lies between the LAST pair only (the bounds stay) -- mutating.QCSXTZZZIBWU
RemoveNthBetween
Remove what lies between the NTH pair only (the bounds stay) -- mutating.QCSXTZZZIBWU
replace many by many 3 examples runQCSXTZZZIBWU
ContainsThese
contains thesealso written: ContainsAllOfThese
composed example
o1 = new stzString("banana split")
? o1.ContainsThese([ "an", "a" ])
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
Same as FindAsSectionsCS: The [start, end] section of every occurrence of pcSubStr. 2 examples runalso written: FindAllAsSections
o1 = new stzString('   str = "  ...  "     and   str !=    "  *** " ')
? @@NL( o1.BoundedBy('"') ) + NL
? @@( o1.FindAsSections( o1.BoundedBy('"') ) )
#--> [ "  ...  ", "     and   str !=    ", "  *** " ]
#--> [ [ 11, 17 ], [ 19, 39 ], [ 41, 46 ] ]
library testQCSXTZZZIBWUD
FindAsSection
Same as FindAsSectionCS: Singular form: returns the first occurrence as a [start, end] section (rather than a list of sections). Useful when the narrative cares about "where IS that one substring".also written: FindFirstAsSection
composed example
o1 = new stzString("banana split")
? @@( o1.FindAsSection("an") )
#--> [ 2, 3 ]
composed from the signature, run for this page
QCSXTZZZIBWUST
Same as FindManyAsSectionsCS: Plural with explicit "Many" prefix: same semantics as FindAsSections but accepts a list of substrings, with the results from all of them flattened into a single ordered list. 1 examples run
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 ] ]
library testQCSXTZZZIBWU
MultiReplaced
Same as MultiReplacedCS: ONE-PASS dictionary replace: old[i] -> new[i], scanning the text ONCE. The FIRST matching pattern (in list order) wins at each position and the scan advances past it -- so a replacement's output is NEVER re-matched (no cascade). Contrast the classic ReplaceManyByMany which runs N sequential Replace passes (N full rebuilds + cascade). For templating, sanitization and dictionary substitution. Patterns must not contain NUL.QCSXTZZZIBWU
MultiReplace
Replace each substring of paOlds with its counterpart in paNews (pairwise, mutating).QCSXTZZZIBWU
ManyReplaced
Same as ManyReplacedCS: Immutable forms of ReplaceMany. Return the new string content without mutating This. Ported from archive line 41923.also written: TheseReplaced · SubStringsReplaced · ManySubstringsReplaced · TheseSubstringsReplaced
composed example
o1 = new stzString("banana split")
? o1.ManyReplaced([ "an", "a" ], "AN")
#--> bANANAN split
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveNth
Same as RemoveNthCS: Remove only the nth occurrence of pcSubStr (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveNth(2, "an")
? o1.Content()
#--> bana split
composed from the signature, run for this page
QCSXTZZZIBWU
Surround
Put pcBefore and pcAfter around the content (mutating). For a copy, use Surrounded.also named: wrap enclose put around bracket withQCSXTZZZIBWU
Surrounded
The content with pcBefore and pcAfter around it, as data.
composed example
o1 = new stzString("banana split")
? o1.Surrounded("an", "an")
#--> anbanana splitan
composed from the signature, run for this page
no extension
Duplicates(): every duplicated SUBSTRING (not just chars), deduped, in (i,j) scan order -- matches the original DuplicatesCS. e.g. "RINGORIALAND" -> [ "R","I","A","N", ...multi-char dups... ]. (For a string with no repeated multi-char run, this coincides with the duplicated chars.) 3 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.Duplicates() )
#--> [ "a", "an", "n", "na" ]
composed from the signature, run for this page
QCSXTZZZIBWU
IsPalindrome
Same as IsPalindromeCS: TRUE if the string reads the same backward (a palindrome).
composed example
o1 = new stzString("banana split")
? o1.IsPalindrome()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
IsPalindromeWords
TRUE if the WORD sequence reads the same backward.
composed example
o1 = new stzString("banana split")
? o1.IsPalindromeWords()
#--> 0
composed from the signature, run for this page
no extension
Same as IsAnagramOfCS: TRUE if the string is an anagram of the given one (same chars, reordered). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsAnagramOf("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
TRUE if the string is in UPPER CASE. 1 examples runalso named: all caps in capitals all uppercase is it shouting
# happy-holidays is lowercase
? StzStringQ("happy-holidays").IsLowercase()
# HOLIDAYS! is uppercase
? StzStringQ("HOLIDAYS!").IsUppercase()
#--> 1
#--> 1
library testno extension
TRUE if the string is in lower case. 4 examples runalso named: all lowercase all small letters in lower case
? Q("bread").IsLowercase()
#--> 1
library testno extension
IsCapitalcase
IsCapitalcase(): TRUE iff the string already equals its TITLE-cased form (every word capitalised), per the original.
composed example
o1 = new stzString("banana split")
? o1.IsCapitalcase()
#--> 0
composed from the signature, run for this page
no extension
IsHybridcase
TRUE if the string mixes upper and lower case.
composed example
o1 = new stzString("banana split")
? o1.IsHybridcase()
#--> 0
composed from the signature, run for this page
no extension
IsTitlecase
TRUE if the string is written in Title Case.
composed example
o1 = new stzString("banana split")
? o1.IsTitlecase()
#--> 0
composed from the signature, run for this page
no extension
IsCamelCase
TRUE if the string is written in camelCase.
composed example
o1 = new stzString("banana split")
? o1.IsCamelCase()
#--> 0
composed from the signature, run for this page
no extension
IsSnakeCase
TRUE if the string is written in snake_case.
composed example
o1 = new stzString("banana split")
? o1.IsSnakeCase()
#--> 0
composed from the signature, run for this page
no extension
IsKebabCase
TRUE if the string is written in kebab-case.
composed example
o1 = new stzString("banana split")
? o1.IsKebabCase()
#--> 0
composed from the signature, run for this page
no extension
ContainsOnlySpaces
TRUE if the string is made of spaces only.
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlySpaces()
#--> 0
composed from the signature, run for this page
no extension
ContainsOnlyLetters
TRUE if the string is made of letters only.
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlyLetters()
#--> 0
composed from the signature, run for this page
no extension
ContainsOnlyNumbers
TRUE if the string is made of number chars only.
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlyNumbers()
#--> 0
composed from the signature, run for this page
no extension
ContainsOnlyDigits
TRUE if the string is made of digits only.
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlyDigits()
#--> 0
composed from the signature, run for this page
no extension
ContainsOnlyLettersAndNumbers
TRUE if the string is made of letters and numbers only.
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlyLettersAndNumbers()
#--> 0
composed from the signature, run for this page
no extension
Same as IsMadeOfCS: TRUE if the string is built ONLY from the given substring(s). 6 examples run
# made of m, a, a, n
? Q("maan").IsMadeOf([ "m", "a", "a", "n" ])
#--> 1
library testQCSXTZZZIBWU
IsMadeOfChar
Same as IsMadeOfCharCS: TRUE if the string is made of the given char only.
composed example
o1 = new stzString("banana split")
? o1.IsMadeOfChar("a")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
Same as IsMadeOfSomeCS: TRUE if the string is made only of (some of) the given substrings. 4 examples run
# all chars are hex digits
? Q("4E992").IsMadeOfSome( HexChars() )
#--> 1
library testQCSXTZZZIBWU
IsCountryName
TRUE if the string names a country (per the locale data).
composed example
o1 = new stzString("banana split")
? o1.IsCountryName()
#--> 0
composed from the signature, run for this page
no extension
IsCountryAbbreviation
TRUE if the string is a country abbreviation (per the locale data).
composed example
o1 = new stzString("banana split")
? o1.IsCountryAbbreviation()
#--> 0
composed from the signature, run for this page
no extension
IsCountryNumber
TRUE if the string is a numeric country code (per the locale data).also written: IsCountryCode
composed example
o1 = new stzString("banana split")
? o1.IsCountryNumber()
#--> 0
composed from the signature, run for this page
no extension
IsCountryPhoneCode
TRUE if the string is a country phone code.
composed example
o1 = new stzString("banana split")
? o1.IsCountryPhoneCode()
#--> 0
composed from the signature, run for this page
no extension
IsLanguageName
TRUE if the string names a language (per the locale data).
composed example
o1 = new stzString("banana split")
? o1.IsLanguageName()
#--> 0
composed from the signature, run for this page
no extension
IsLanguageNumber
TRUE if the string is a numeric language code.also written: IsLanguageCode
composed example
o1 = new stzString("banana split")
? o1.IsLanguageNumber()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a language abbreviation. 2 examples run
? StzStringQ("ar").IsLanguageAbbreviation()
? IsLanguageAbbreviation("ar")
#--> 1
#--> 1
library testno extension
TRUE if the string has an ISO locale shape (like en-US). 2 examples run
o1 = new stzString("ar_Arab_TN")
# well formed
? o1.IsLocaleAbbreviation()
#--> 1
library testno extension
IsCurrencyName
TRUE if the string names a currency (per the locale data).
composed example
o1 = new stzString("banana split")
? o1.IsCurrencyName()
#--> 0
composed from the signature, run for this page
no extension
IsCurrencySymbol
Currency-symbol check (stub: the monolith left it TODO; completes with the locale data).
composed example
o1 = new stzString("banana split")
? o1.IsCurrencySymbol()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string names a script (per the locale data). 2 examples runalso written: IsScript
# yes
? StzStringQ("latin").IsScriptName()
#--> 1
library testno extension
TRUE if the string is a script code. 1 examples runalso written: IsScriptNumber
composed example
o1 = new stzString("banana split")
? o1.IsScriptCode()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a script abbreviation. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsScriptAbbreviation()
#--> 0
composed from the signature, run for this page
no extension
ContainsOneOccurrence
Same as ContainsOneOccurrenceCS: TRUE if the substring occurs EXACTLY once.also written: ContainsOne · ContainsOnlyOne
composed example
o1 = new stzString("banana split")
? o1.ContainsOneOccurrence("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
Same as ContainsNTimesCS: TRUE if the substring occurs exactly n times. 2 examples run
? Q("ar_arab_tn").ContainsNTimes(2,"_")
#--> 1
library testQCSXTZZZIBWU
RepresentsInteger
TRUE if the string is an integer literal.also written: RepresentsCalculableInteger
composed example
o1 = new stzString("banana split")
? o1.RepresentsInteger()
#--> 0
composed from the signature, run for this page
no extension
RepresentsSignedInteger
TRUE if the string is a SIGNED integer literal.
composed example
o1 = new stzString("banana split")
? o1.RepresentsSignedInteger()
#--> 0
composed from the signature, run for this page
no extension
RepresentsUnsignedInteger
TRUE if the string is an UNSIGNED integer literal.
composed example
o1 = new stzString("banana split")
? o1.RepresentsUnsignedInteger()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a real-number literal (carries a fractional dot). 2 examples runalso written: IsRealInString · IsARealInString · RepresentsRealInString · RepresentsCalculableRealNumber
# yes
? Q("12500543.12").RepresentsRealNumber()
#--> 1
library testno extension
RepresentsSignedNumber
TRUE if the string is a SIGNED number literal.
composed example
o1 = new stzString("banana split")
? o1.RepresentsSignedNumber()
#--> 0
composed from the signature, run for this page
no extension
RepresentsUnsignedNumber
TRUE if the string is an UNSIGNED number literal.
composed example
o1 = new stzString("banana split")
? o1.RepresentsUnsignedNumber()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string holds a numeric literal. 3 examples run
# IsNumberInString on a space
? Q(" ").IsNumberInString()
#--> 0
library testno extension
TRUE if the string holds a list literal (normal or computable form). 3 examples run
# a bracketed list
? StzStringQ("[ 2, 3, 5:7 ]").IsListInString()
# a char range
? StzStringQ("'A':'F'").IsListInString()
#--> 1
#--> 1
library testno extension
FilledWith
FilledWith(pItem): for an empty (or any) wrapped string, set the content to the string form of pItem and return it. Used for the 'start from an empty stzString and fill it with this value' fluent shape.
composed example
o1 = new stzString("banana split")
? o1.FilledWith("a")
#--> a
composed from the signature, run for this page
QCSXTZZZIBWU
ToList
ToList: if the string represents a Haro list literal ("[1,2,3]"), eval it into the actual list. Otherwise returns the chars. Used by stzSmallFuncs.StzN to count list-in-string elements.
composed example
o1 = new stzString("banana split")
? @@( o1.ToList() )
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]
composed from the signature, run for this page
QCSXTZZZIBWU
TRUE if the string is a valid number literal (any base form). 2 examples runalso written: RepresentsCalculableNumber
composed example
o1 = new stzString("banana split")
? o1.RepresentsNumber()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a decimal number literal. 1 examples runalso written: RepresentsNumberInDecimalForm
composed example
o1 = new stzString("banana split")
? o1.RepresentsDecimalNumber()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a binary number literal. 2 examples runalso written: RepresentsNumberInBinaryForm
# plain
? Q("0b110001.1001").RepresentsNumberInBinaryForm()
# signed before the prefix
? Q("-0b110001.1001").RepresentsNumberInBinaryForm()
# sign inside: malformed
? Q("0b-110001.1001").RepresentsNumberInBinaryForm()
#--> 1
#--> 1
#--> 0
library testno extension
TRUE if the string is a hexadecimal number literal. 2 examples runalso written: RepresentsNumberInHexForm
# hex form
? Q("x4E992").RepresentsNumberInHexForm()
#--> 1
library testno extension
TRUE if the string is an octal number literal. 2 examples runalso written: RepresentsNumberInOctalForm
# octal form
? Q("o01234567").RepresentsNumberInOctalForm()
#--> 1
library testno extension
IsBlank
TRUE if the string is empty or whitespace only.
composed example
o1 = new stzString("banana split")
? o1.IsBlank()
#--> 0
composed from the signature, run for this page
no extension
IsIdentifier
TRUE if the string is a valid identifier (letter or underscore first, then letters, digits, underscores).
composed example
o1 = new stzString("banana split")
? o1.IsIdentifier()
#--> 0
composed from the signature, run for this page
no extension
IsBalanced
TRUE if the brackets and parentheses in the string are balanced.
composed example
o1 = new stzString("banana split")
? o1.IsBalanced()
#--> 1
composed from the signature, run for this page
no extension
IsNestedUsing
Different from IsBalanced (which only checks balance of opens and closes) -- this answers whether the structure has any proper nesting depth >= 2.
composed example
o1 = new stzString("banana split")
? o1.IsNestedUsing("an", "an")
#--> 1
composed from the signature, run for this page
no extension
IsNested
TRUE if the string's bounds nest (bounded regions inside bounded regions).
composed example
o1 = new stzString("banana split")
? o1.IsNested()
#--> 0
composed from the signature, run for this page
no extension
IsEmailLike
TRUE if the string looks like an email address.
composed example
o1 = new stzString("banana split")
? o1.IsEmailLike()
#--> 0
composed from the signature, run for this page
no extension
IsUrlLike
TRUE if the string looks like a URL.no extension
IsPangram
TRUE if the string uses every letter of the alphabet (a pangram).
composed example
o1 = new stzString("banana split")
? o1.IsPangram()
#--> 0
composed from the signature, run for this page
no extension
IsIsogram
TRUE if no char repeats in the string (an isogram).
composed example
o1 = new stzString("banana split")
? o1.IsIsogram()
#--> 0
composed from the signature, run for this page
no extension
IsWord
TRUE if the string is a single word.
composed example
o1 = new stzString("banana split")
? o1.IsWord()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a single letter. 2 examples run
# * is not a letter, computationally
? NOT Q("*").IsLetter()
# ... and linguistically
? Q("*").IsNotLetter()
#--> 1
#--> 1
library testno extension
IsADigit
TRUE if the string is a single digit.
composed example
o1 = new stzString("banana split")
? o1.IsDigit()
#--> 0
composed from the signature, run for this page · written IsADigit() in the library today: the host language already holds IsDigit(), and Haro removes the detour
no extension
IsCharsSortedAscending
TRUE if the chars are in ascending order.also written: IsCharsSortedAsc
composed example
o1 = new stzString("banana split")
? o1.IsCharsSortedAscending()
#--> 0
composed from the signature, run for this page
no extension
IsCharsSortedDescending
TRUE if the chars are in descending order.also written: IsCharsSortedDesc
composed example
o1 = new stzString("banana split")
? o1.IsCharsSortedDescending()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string starts with a repeated char run. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.HasLeadingChars()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
TRUE if the string ends with a repeated char run. 2 examples run
composed example
o1 = new stzString("banana split")
? o1.HasTrailingChars()
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
HasLeadingAndTrailingChars
TRUE if the string both starts AND ends with repeated char runs.
composed example
o1 = new stzString("banana split")
? o1.HasLeadingAndTrailingChars()
#--> 0
composed from the signature, run for this page
no extension
IsReversedCopyOf
Same as IsReversedCopyOfCS: TRUE if the string is the reverse of the given one.
composed example
o1 = new stzString("banana split")
? o1.IsReversedCopyOf("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsLatin
TRUE if the string contains Latin chars.
composed example
o1 = new stzString("banana split")
? o1.ContainsLatin()
#--> 1
composed from the signature, run for this page
no extension
ContainsArabic
TRUE if the string contains Arabic chars.
composed example
o1 = new stzString("banana split")
? o1.ContainsArabic()
#--> 0
composed from the signature, run for this page
no extension
ContainsChar
Same as ContainsCharCS: TRUE if the string contains the given char.
composed example
o1 = new stzString("banana split")
? o1.ContainsChar("an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsAnyOfChars
Same as ContainsAnyOfCharsCS: contains char / any / all
composed example
o1 = new stzString("banana split")
? o1.ContainsAnyOfChars("an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsAllOfChars
Same as ContainsAllOfCharsCS: contains char / any / all
composed example
o1 = new stzString("banana split")
? o1.ContainsAllOfChars("an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsOnlyChars
Same as ContainsOnlyCharsCS: contains char / any / all
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlyChars("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
FindInvisibleChars
The positions of the invisible chars.no extension
InvisibleChars
The invisible chars of the string, as a list.no extension
ContainsInvisibleChars
TRUE if the string contains invisible chars.
composed example
o1 = new stzString("banana split")
? o1.ContainsInvisibleChars()
#--> 1
composed from the signature, run for this page
no extension
IsControl
TRUE if the string is made of control chars.
composed example
o1 = new stzString("banana split")
? o1.IsControl()
#--> 0
composed from the signature, run for this page
no extension
HasMark
control / mark checks
composed example
o1 = new stzString("banana split")
? o1.HasMark()
#--> 0
composed from the signature, run for this page
no extension
CharIsControlAt
control / mark checks
composed example
o1 = new stzString("banana split")
? o1.CharIsControlAt(2)
#--> 0
composed from the signature, run for this page
no extension
CharIsMarkAt
control / mark checks
composed example
o1 = new stzString("banana split")
? o1.CharIsMarkAt(2)
#--> 0
composed from the signature, run for this page
no extension
CharIsSpaceAt
control / mark checks
composed example
o1 = new stzString("banana split")
? o1.CharIsSpaceAt(2)
#--> 0
composed from the signature, run for this page
no extension
OnlyMarks
only marks / controlsno extension
OnlyControls
only marks / controlsno extension
OnlyLatinLetters
only marks / controls
composed example
o1 = new stzString("banana split")
? o1.OnlyLatinLetters()
#--> bananasplit
composed from the signature, run for this page
no extension
IsNumericString
TRUE if the string is numeric.also written: IsANumber
composed example
o1 = new stzString("banana split")
? o1.IsNumericString()
#--> 0
composed from the signature, run for this page
no extension
IsAlphaString
numeric / alpha checksalso written: IsAllLetters
composed example
o1 = new stzString("banana split")
? o1.IsAlphaString()
#--> 0
composed from the signature, run for this page
no extension
MatchesRegex
TRUE if the string matches the given regex pattern.also written: IsMatchedByRegex
composed example
o1 = new stzString("banana split")
? o1.MatchesRegex("an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ENGINE-BACKED (StzEngineStringSubStrings): all substrings in (i,j) order, no dedup. Retires the O(n^2) Haro double-loop. 5 examples runalso written: Substrinks · Substrongs
o1 = new stzString("RINGORIALAND")
# there are 12*13/2 = 78 substrings
? o1.NumberOfSubStrings()
# SubStrings() returns that many
? len( o1.SubStrings() )
#--> 78
#--> 78
library testQCSXTZZZIBWUWF
How many substrings the string yields. 4 examples runalso written: HowManySubStrings
o1 = new stzString("..ONE..TWO..ONE..")
# all substrings
? o1.NumberOfSubStrings()
# unique substrings
? o1.NumberOfUniqueSubStrings()
#--> 153
#--> 120
library testQCSXTZZZIBWU
UniqueSubStrings
Same as SubStringsU: Same as SubStringsCS: ENGINE-BACKED (StzEngineStringSubStringsUniqueCS): dedup, first-seen order. cs=1 exact, cs=0 case-insensitive. Retires the O(n^3) loop.no extension
How many DISTINCT substrings the string yields. 1 examples run
o1 = new stzString("..ONE..TWO..ONE..")
# all substrings
? o1.NumberOfSubStrings()
# unique substrings
? o1.NumberOfUniqueSubStrings()
#--> 153
#--> 120
library testno extension
IndexOf
(no comment in the source: the name reads as a sentence) index ofin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? o1.IndexOf("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWU
FindAllChar
(no comment in the source: the name reads as a sentence) find all charin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? @@( o1.FindAllChar("an") )
#--> [ 2, 4, 6 ]
composed from the signature, run for this page
no extension
StartsWithAny
Same as StartsWithAnyCS: TRUE if the string starts with ANY of the given prefixes.
composed example
o1 = new stzString("banana split")
? o1.StartsWithAny("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
EndsWithAny
(no comment in the source: the name reads as a sentence) ends with anyin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? o1.EndsWithAny("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
FindBetweenAsSection
(no comment in the source: the name reads as a sentence) find between as sectionin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? @@( o1.FindBetweenAsSection("an", "an") )
#--> [ 3, 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindBetweenAsSections
FindBetweenAsSections takes EITHER 2 or 3 args (Haro lacks optional params), so the 3-arg form lives at a separate method name -- the alias below accepts both via Haro's lookup rules.no extension
FindBoundedByAsSections
Same as FindBoundedByAsSectionsCS: The [start, end] sections of the substrings bounded by the given bounds.
composed example
o1 = new stzString("banana split")
? @@( o1.FindBoundedByAsSections([ "an", "a" ]) )
#--> [ [ 4, 3 ], [ 6, 5 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindAnyBoundedByAsSections
The [start, end] sections of the substrings bounded by any of the given bounds.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedByAsSections([ "an", "a" ]) )
#--> [ [ 4, 3 ], [ 6, 5 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindAnyBoundedBy
FindAnyBoundedBy(pacBounds): single-arg form. Accepts a list [open, close] or a single string used for both ends.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedBy([ "an", "a" ]) )
#--> [ 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindAnyBoundedByIBAsSections
Same as FindSubStringsBoundedByIBZZ: FindSubStringsBoundedByIBZZ: for every substring bounded by pacBounds[1]..pacBounds[2] return the [startPos, endPos] pairs INCLUDING the bounds (IB = inclusive bounds). Ported from archive line 34794; self-contained scan rather than the SectionsBetween-based archive version.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedByIBAsSections([ "an", "a" ]) )
#--> [ [ 2, 4 ] ]
composed from the signature, run for this page
no extension
DeepFindBoundedByZZ
The [start, end] sections of the bounded substrings at EVERY nesting depth.also written: DeepFindSubStringsZZ · DeepFindSubStringsBoundedByZZ
composed example
o1 = new stzString("banana split")
? @@( o1.DeepFindBoundedByZZ([ "an", "a" ]) )
#--> [ [ 6, 5 ] ]
composed from the signature, run for this page
no extension
DeepBoundedBy
The bounded substrings at every nesting depth.QCSXTZZZIBWU
DeepSubStringsZZ
The nested bounded substrings with their [start, end] sections.also written: DeepSubStringsBoundedByZZ
composed example
o1 = new stzString("banana split")
? @@( o1.DeepSubStringsZZ([ "an", "a" ]) )
#--> [ [ "", [ 6, 5 ] ] ]
composed from the signature, run for this page
no extension
DeepFindBoundedByIBZZ
The nested bounded sections, bounds INCLUDED (IB).also written: DeepFindSubStringsBoundedByIBZZ
composed example
o1 = new stzString("banana split")
? @@( o1.DeepFindBoundedByIBZZ([ "an", "a" ]) )
#--> [ [ 4, 6 ] ]
composed from the signature, run for this page
no extension
DeepSubStringsBoundedByIBZZ
The nested bounded substrings, bounds included, with their sections.
composed example
o1 = new stzString("banana split")
? @@( o1.DeepSubStringsBoundedByIBZZ([ "an", "a" ]) )
#--> [ [ "ana", [ 4, 6 ] ] ]
composed from the signature, run for this page
no extension
NestedSubStrings
The bounded substrings including the NESTED ones.QCSXTZZZIBWU
RemoveSubStringsBoundedByIB
RemoveSubStringsBoundedByIB([o,c]): drop every bounded region together with -- its bounds (e.g. removing the "]---[" runs from "Hello ]---[Haro!]---[" -> -- "Hello Haro!"). MUTATING; returns This.QCSXTZZZIBWU
FindSubStringsAsSectionsW(pcCondition): enumerate every substring [start, end] and return the sections where the @SubString predicate is TRUE. Engine-backed (stzList.FindW over the candidates), no eval(). FindSubStringsAsSectionsW(pcCondition): the [start,end] sections of every substring matching the predicate. Engine-backed -- enumerates the candidate substrings and evaluates the @SubString predicate via the list W-DSL (stzList.FindW, predicate normalized: { } stripped, @SubString -> @item, Q().Method() lowered), with NO eval(). For engine-expressible predicates (=, or, and, comparisons); for richer ones use the WF form below. Replaces the retired raw-eval FindSubStringsAsSectionsWXT. 1 examples run
# the length-4 sections containing a heart pair
? @@( Q("..♥^^♥..^♥♥^..").FindSubStringsAsSectionsWF( func s { return Q(s).NumberOfChars() = 4 and Q(s).ContainsCS("♥♥", 1) } ) )
#--> [ [ 8, 11 ], [ 9, 12 ], [ 10, 13 ] ]
library testQCSXTZZZIBWUF
The positions of the substrings satisfying the W condition. 1 examples run
# the matching substrings
? @@( Q("...ONE...TWO...ONE").FindSubStringsW('{ @SubString = "ONE" or @SubString = "TWO" }') )
# FindSubStringsWZZ gives their sections
? @@( Q("...ONE...TWO...ONE").FindSubStringsWZZ('{ @SubString = "ONE" or @SubString = "TWO" }') )
#--> [ "ONE", "TWO", "ONE" ]
#--> [ [ 4, 6 ], [ 10, 12 ], [ 16, 18 ] ]
library testQCSXTZZZIBWUF
FindSubStringsMadeOf
FindSubStringsMadeOf(pcChar): return the start positions of each MAXIMAL run of pcChar in the content. e.g. "..._...__" with pcChar="_" -> [4, 8]. "Made of" runs: the arg is a POOL of chars ("12" = chars 1 and 2), and a run is a maximal stretch whose every char belongs to the pool.also written: FindMadeOf
composed example
o1 = new stzString("banana split")
? @@( o1.FindSubStringsMadeOf("an") )
#--> [ 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindNthOccurrenceCS / FindNthOccurrence: n-th match of pcSub inside the content. Engine-backed. (case-sensitive by default) 1 examples run
composed example
o1 = new stzString("banana split")
? o1.FindNthOccurrence(2, "an")
#--> 4
composed from the signature, run for this page
QCSXTZZZIBWU
AllPositionsOf
All positions of pcSub (collect-them-all helper).also written: FindMarker · FindMarquer · OccurrencesOfMarquer
composed example
o1 = new stzString("banana split")
? @@( o1.AllPositionsOf("an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
FindFirstNOccurrences
FindFirstNOccurrences(n, pcSub): the first n positions where pcSub appears in the content.
composed example
o1 = new stzString("banana split")
? @@( o1.FindFirstNOccurrences(2, "an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
FindLastNOccurrences
FindLastNOccurrences(n, pcSub): the last n positions.
composed example
o1 = new stzString("banana split")
? @@( o1.FindLastNOccurrences(2, "an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
HowMany family: count occurrences of pcSub in the content. 2 examples run
composed example
o1 = new stzString("banana split")
? o1.HowMany("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWUST
How long the trailing char run is. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.HowManyTrailingChar()
#--> 0
composed from the signature, run for this page
no extension
HowManyLeadingChar
How long the leading char run is.
composed example
o1 = new stzString("banana split")
? o1.HowManyLeadingChar()
#--> 0
composed from the signature, run for this page
no extension
HowManyOccurrenceOfCharRightSide
HowManyOccurrenceOfCharRightSide(pcChar) / EndSide: count the trailing run of pcChar.also written: HowManyOccurrenceOfCharEndSide · NumberOfOccurrenceOfCharEndSide · NumberOfOccurrenceOfCharRightSide · NumberOfOccurrenceOfCharEndingSide
composed example
o1 = new stzString("banana split")
? o1.HowManyOccurrenceOfCharRightSide("an")
#--> 0
composed from the signature, run for this page
no extension
HowManyOccurrenceOfCharLeftSide
How many times the char repeats at the START of the string.also written: HowManyOccurrenceOfCharStartSide · NumberOfOccurrenceOfCharLeftSide · NumberOfOccurrenceOfCharStartSide · NumberOfOccurrenceOfCharStartingSide
composed example
o1 = new stzString("banana split")
? o1.HowManyOccurrenceOfCharLeftSide("an")
#--> 0
composed from the signature, run for this page
no extension
SubStringsMadeOf
SubStringsMadeOf(pcChar): the actual matching substrings (each maximal run as a single string).
composed example
o1 = new stzString("banana split")
? @@( o1.SubStringsMadeOf("an") )
#--> [ "anana" ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindSubStringBoundsUpToNCharsAsSections
FindSubStringBoundsUpToNCharsAsSections(pcSub, n) -- for each occurrence of pcSub, return the [startBefore, endBefore] section of up to n chars to its LEFT and the [startAfter, endAfter] section of up to n chars to its RIGHT. Returns a flat list of all such sections.also written: FindSubStringBoundsUpToNChars
composed example
o1 = new stzString("banana split")
? @@( o1.FindSubStringBoundsUpToNCharsAsSections("an", 2) )
#--> [ [ 1, 1 ], [ 4, 5 ], [ 2, 3 ], [ 6, 7 ] ]
composed from the signature, run for this page
no extension
FindSubStringsBoundedBy(pacBounds): return the starting positions of each substring that sits between the open / close bounds. The bounds list may use the [open, :And = close] DSL shape or a plain [open, close] / single string for both ends. 1 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.FindSubStringsBoundedBy([ "an", "a" ]) )
#--> [ 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindSubStringsBetween
Find the substrings lying between the two given bounds.
composed example
o1 = new stzString("banana split")
? @@( o1.FindSubStringsBetween("an", "an") )
#--> [ 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindSubStringBoundedBy
FindSubStringBoundedBy(pcWhat, pacBounds): return positions (only inside bounded sections) where pcWhat appears.QCSXTZZZIBWU
FindSubStringBoundedByAsSections
Same as FindSubStringBoundedByZZ: FindSubStringBoundedBy(pcWhat, pacBounds): return positions (only inside bounded sections) where pcWhat appears. (answers [start, end] sections)no extension
FindBoundedSubString
FindBoundedSubString(pcSub): the start positions of the occurrences of pcSub that carry non-space bound runs on BOTH sides (a 2-list arg keeps the legacy BoundedBy behavior).
composed example
o1 = new stzString("banana split")
? @@( o1.FindBoundedSubString("an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindBoundedSubStrings
Find the bounded substrings (polymorphic: one substring or an [open, close] pair).
composed example
o1 = new stzString("banana split")
? @@( o1.FindBoundedSubStrings("an") )
#--> [ [ 2, 3 ], [ 4, 5 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindSubStringBounds
FindSubStringBounds(pcSub): the FLAT start positions of the bound runs (left then right, per bounded occurrence, in order).
composed example
o1 = new stzString("banana split")
? @@( o1.FindSubStringBounds("an") )
#--> [ 1, 4, 3, 6 ]
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveTrailingSubString
Same as RemoveTrailingChars: Drop the whole trailing run of the string's last char (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveTrailingSubString()
? o1.Content()
#--> banana spli
composed from the signature, run for this page
QCSXTZZZIBWU
Find the position of the next n-th marker after nFrom. 1 examples runalso written: FindNextNthMarker
composed example
o1 = new stzString("banana split")
? o1.FindNextNthMarquer(2, 5)
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWUST
ContainsSubStringBoundedBy(pcSub, pacBounds): TRUE if pcSub appears inside any bounded section. 1 examples run
# '♥♥♥' is enclosed by '^^' .. '^^'
? Q("^^♥♥♥^^").ContainsSubStringBoundedBy("♥♥♥", [ "^^", "^^" ])
#--> 1
library testQCSXTZZZIBWU
FindAsSectionsStD
(Haro is case-insensitive; one method name covers StD / STD.)
composed example
o1 = new stzString("banana split")
? @@( o1.FindAsSectionsStD("an", 2, :Forward) )
#--> [ [ 2, 3 ], [ 4, 5 ] ]
composed from the signature, run for this page
no extension
HexUnicodes
HexUnicodes(): hex codepoints for every char, returned as a list.also written: HexUnicodes_alias
composed example
o1 = new stzString("banana split")
? @@( o1.HexUnicodes() )
#--> [ "U+0062", "U+0061", "U+006E", "U+0061", "U+006E", "U+0061", "U+0020", "U+0073", "U+0070", "U+006C", "U+0069", "U+0074" ]
composed from the signature, run for this page
no extension
First2CharsAsString
First2CharsAsString / Last2CharsAsString: aliases.
composed example
o1 = new stzString("banana split")
? o1.First2CharsAsString()
#--> ba
composed from the signature, run for this page
no extension
Last2CharsAsString
The last two chars, as a string.
composed example
o1 = new stzString("banana split")
? o1.Last2CharsAsString()
#--> it
composed from the signature, run for this page
no extension
RemoveSpacesQ_alias
RemoveSpacesQ on stzString -- fluent form (existing RemoveSpaces at line ~6094 isn't followed by a Q form). Wrap and return This.no extension
SpacifySections(aSections [, pcSep]): insert pcSep between every pair of consecutive chars inside each [n1, n2] section. pcSep defaults to " " when the second arg is omitted. 1 examples run
o1 = new stzString("Ringprogramminglanguageispowerful!")
o1.SpacifySections([ [ 5, 15 ], [ 24, 25 ] ])
# each section's chars are spaced out
? o1.Content()
#--> Ringp r o g r a m m i n glanguagei spowerful!
library testQCSXTZZZIBWU
Shrink(): trim leading + trailing whitespace. Shrink([p1]): Shrink() : Trim Shrink(:ToPosition = N) : keep first N chars Shrink(N) : keep first N chars Implemented as 1-arg with optional sentinel NULL/empty for trim. 1 examples run
o1 = new stzString("ABCDE")
o1.Shrink( :ToPosition = 3 )
# 'ABCDE' shrunk to position 3
? o1.Content()
#--> ABC
library testQCSXTZZZIBWU
ShortenN(n): same as ShortenedN but mutates in place. 1 examples run
composed example
o1 = new stzString("banana split")
o1.ShortenN(2)
? o1.Content()
#--> ba...it
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsInSections(pcSub, aSections): TRUE if pcSub appears inside ANY of the listed sections. 1 examples run
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
library testno extension
ContainsBefore(pcSub, pcAnchor | :Position = n | :SubString = s): TRUE iff pcSub appears in the content BEFORE the anchor. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsBefore("an", "an")
#--> 0
composed from the signature, run for this page
no extension
TRUE if pcSub occurs AFTER the anchor substring. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsAfter("an", "an")
#--> 1
composed from the signature, run for this page
no extension
ContainsOnlyOneOfThese(paSubStr): TRUE iff EXACTLY ONE of the listed substrings appears in the content (counting at least one occurrence as 1). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsOnlyOneOfThese([ "an", "a" ])
#--> 0
composed from the signature, run for this page
no extension
IsReverseOf
IsReverseOf(pcOther): TRUE iff This.Content() is the reverse of pcOther (codepoint-by-codepoint).
composed example
o1 = new stzString("banana split")
? o1.IsReverseOf("an")
#--> 0
composed from the signature, run for this page
no extension
HexUnicode
HexUnicode(): hex form of the codepoint (e.g. "A" -> "0041"). When the content is a single char, returns its codepoint hex; otherwise the codepoint of the first char.
composed example
o1 = new stzString("banana split")
? o1.HexUnicode()
#--> U+0062
composed from the signature, run for this page
no extension
First2Chars
The first two chars, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.First2Chars() )
#--> [ "b", "a" ]
composed from the signature, run for this page
no extension
Last2Chars
The last two chars, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.Last2Chars() )
#--> [ "i", "t" ]
composed from the signature, run for this page
no extension
Last3Chars
The last three chars, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.Last3Chars() )
#--> [ "l", "i", "t" ]
composed from the signature, run for this page
no extension
First3Chars
The first three chars, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.First3Chars() )
#--> [ "b", "a", "n" ]
composed from the signature, run for this page
no extension
The first n chars, as a string. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.FirstNChars(2)
#--> ba
composed from the signature, run for this page
no extension
The last n chars, as a string. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.LastNChars(2)
#--> it
composed from the signature, run for this page
no extension
ExtendToNChars(n): pad content with spaces up to length n. 1 examples run
o1 = new stzString("ABC")
o1.ExtendToNChars(5)
# 'ABC' padded to width 5
? o1.Content()
#--> ABC
library testQCSXTZZZIBWU
Spacified / SpacifiedUsing / SpacifiedXT: non-mutating Spacify variants. Return the spaced-out string without altering This. 3 examples runalso named: add spaces between characters space out letter spacing
# spaces between
? Q("SOFTANZA").Spacified()
#--> S O F T A N Z A
library testQCSXTZZZIBWU
A copy with the chars separated by the given separator. 1 examples run
o1 = new stzString("99999999999")
# Spacified() spaces the chars
? o1.Spacified()
# SpacifiedUsing('_') uses underscores
? o1.SpacifiedUsing("_")
#--> 9 9 9 9 9 9 9 9 9 9 9
#--> 9_9_9_9_9_9_9_9_9_9_9
library testno extension
SpacifyTheseSubStrings(paSubStr [, pcSep]): wrap each occurrence of every substring in paSubStr with pcSep on each side. pcSep defaults to " " when the second arg is omitted. 1 examples run
o1 = new stzString("MahmoudBertAhmedMansourIlirGalMajdi")
o1.SpacifyTheseSubStrings([
		"Mahmoud", "Bert", "Ahmed", "Mansour", "Ilir", "Gal", "Majdi" ])
# the names separate with single spaces, no edge spaces
? o1.Content()
#--> Mahmoud Bert Ahmed Mansour Ilir Gal Majdi
library testQCSXTZZZIBWU
SplitAtSections
SplitAtSections(aSections): the pieces of content sliced by the listed [n1, n2] sections. Each section becomes one piece. SplitAtSections(aSections): split AT the sections -- return the COMPLEMENT parts between them (the original monolith routes the complement computation through stzSplitter).no extension
SplitAtCharsW(pcCondition): split content at every char where the predicate is TRUE. Same semantics as SplitW, spelled for char-narratives. 1 examples run
# 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" ]
library testno extension
CommonSubStrings
CommonSubStrings(:With = pcOther): substrings appearing in both This and pcOther (set-style intersection at the char-substring level, capped at the smaller string's substring count).no extension
EndsWithNumberN(pcNumStr): TRUE if the content ENDS with the given number-as-string. Accepts optional leading sign in pcNumStr. 3 examples runalso written: EndsWithThisNumber
composed example
o1 = new stzString("banana split")
? o1.EndsWithNumberN("an")
#--> 0
composed from the signature, run for this page
no extension
(EndsWithNumber zero-arg form already exists above as nested alias; the 1-arg "ends with this number" variant is reachable via EndsWithNumberN.) TheseBoundsRemoved(pcOpen, pcClose): return the content with pcOpen stripped from start and pcClose from end (only when both are present in those positions). 3 examples run
o1 = new stzString("<<Go!>>")
# the bounds fall away
? o1.TheseBoundsRemoved("<<", ">>")
#--> Go!
library testQCSXTZZZIBWU
RemoveEmptyLines
RemoveEmptyLines / RemoveEmptyLinesQ: drop lines that are empty (after trim).QCSXTZZZIBWU
TRUE if the string's dominant script is the given one. 2 examples runalso written: IsScriptOf
# spaces are Common
? StzStringQ("  ").IsScriptOf(:Common)
# a dhammah is Inherited
? StzStringQ(ArabicDhammah()).IsScriptOf(:Inherited)
#--> 1
#--> 1
library testno extension
RemoveAt
RemoveAt -- two shapes: RemoveAt(n) -- remove single char at position n RemoveAt(n, pcSub) -- remove pcSub at position n
composed example
o1 = new stzString("banana split")
o1.RemoveAt(2, "an")
? o1.Content()
#--> bana split
composed from the signature, run for this page
QCSXTZZZIBWU
IsQuietEqualTo(pcOther): "quiet" equality -- accept up to ~30% char-level mismatches. Useful for fuzzy comparisons. Uses Levenshtein-style distance with simple thresholding. 3 examples run
composed example
o1 = new stzString("banana split")
? o1.IsQuietEqualTo("an")
#--> 0
composed from the signature, run for this page
no extension
NextOccurrence(pcSub, nFrom): position of the next occurrence of pcSub strictly after nFrom. 2 examples run
o1 = new stzString("12500;NAME;10;0")
# the next one from 1
? o1.NextOccurrence( :Of = ";", :StartingAt = 1 )
# the 2nd from 5
? o1.NextNthOccurrence( 2, :Of = ";", :StartingAt = 5)
#--> 6
#--> 11
library testno extension
PreviousOccurrence
PreviousOccurrence(sub, nFrom): the last occurrence lying ENTIRELY before nFrom (the original searches Section(1, nFrom-1), so an occurrence overlapping nFrom does not count).
composed example
o1 = new stzString("banana split")
? o1.PreviousOccurrence("an", 2)
#--> 0
composed from the signature, run for this page
no extension
RepeatedLeadingChar(): the single char that begins a leading run of repeated chars (or "" if no run). 2 examples run
o1 = new stzString("exeeeeeTUNIS")
# no repeated leading char
? o1.RepeatedLeadingChar()
# empty list
? len( o1.RepeatedLeadingChars() )
#--> 0
library testno extension
RepeatedTrailingChar
The char repeated at the end of the string.no extension
NumberOfRepeatedLeadingChars
How long the repeated run at the start is.
composed example
o1 = new stzString("banana split")
? o1.NumberOfRepeatedLeadingChars()
#--> 0
composed from the signature, run for this page
no extension
NumberOfRepeatedTrailingChars
How long the repeated run at the end is.
composed example
o1 = new stzString("banana split")
? o1.NumberOfRepeatedTrailingChars()
#--> 0
composed from the signature, run for this page
no extension
SectionsOfSameItems
SectionsOfSameItems(): contiguous runs of equal chars as [start, end] sections.
composed example
o1 = new stzString("banana split")
? @@( o1.SectionsOfSameItems() )
#--> [ [ 1, 1 ], [ 2, 2 ], [ 3, 3 ], [ 4, 4 ], [ 5, 5 ], [ 6, 6 ], [ 7, 7 ], [ 8, 8 ], [ 9, 9 ], [ 10, 10 ], [ 11, 11 ], [ 12, 12 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceAnyBoundedBy(pacBounds, pcNew): wrapper over the substrings-bounded-by-replace family. 2 examples run
composed example
o1 = new stzString("banana split")
o1.ReplaceAnyBoundedBy([ "an", "a" ], "AN")
? o1.Content()
#--> banANana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceManyPairs
(ReplaceMany 2-list form: per-index pcOld[i] -> pcNew[i] via the existing ReplaceMany above.)QCSXTZZZIBWU
AntiFindAsSection
AntiFindAsSection: alias for the singular form (just first section from AntiFindAsSections, or [] if none). AntiFindAsSection: the FIRST complement span (the first gap not covered by an occurrence of pcSub).
composed example
o1 = new stzString("banana split")
? @@( o1.AntiFindAsSection("an") )
#--> [ 1, 1 ]
composed from the signature, run for this page
no extension
Trailing/leading number helpers. TrailingNumber / LeadingNumber: decimal- and SIGN-aware, so "Amount: -132.45" trails "-132.45" and "-23.67 pounds" leads with "-23.67". 3 examples runalso written: EndingNumberno extension
The number the string STARTS with, as a string (empty if none). 1 examples runalso written: StartingNumberno extension
NumberOfTrailingNumberDigits
How many digits the trailing number has.
composed example
o1 = new stzString("banana split")
? o1.NumberOfTrailingNumberDigits()
#--> 0
composed from the signature, run for this page
no extension
NumberOfLeadingNumberDigits
How many digits the leading number has.
composed example
o1 = new stzString("banana split")
? o1.NumberOfLeadingNumberDigits()
#--> 0
composed from the signature, run for this page
no extension
Bounds
Bounds(pcOpen, pcClose): the [open, close] positions of the first bounded match. Two-arg form. Bounds(): auto-detect leading and trailing non-letter runs - e.g. "<<Haro>>" -> [ "<<", ">>" ], "---Ring___" -> [ "---", "___" ]. Falls back to [ firstchar, lastchar ] for fully alphanumeric input. Bounds(): auto-detect the leading/trailing bound. Each side is the maximal run of the SAME edge char (when it is a bound char), so "<<Go!>>" -> [ "<<", ">>" ] -- the "!" is content, NOT swallowed into the trailing bound (the old "any non-alpha" walk greedily took "!>>").
composed example
o1 = new stzString("banana split")
? @@( o1.Bounds() )
#--> [ "b", "t" ]
composed from the signature, run for this page
QCSXTZZZIBWU
BoundsBetween
The [open, close] bounds found between the given pair.
composed example
o1 = new stzString("banana split")
? @@( o1.BoundsBetween("an", "an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
HasRepeatedLeadingChars(): TRUE if the content begins with a run of identical chars (length >= 2). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.HasRepeatedLeadingChars()
#--> 0
composed from the signature, run for this page
no extension
HasRepeatedTrailingChars
TRUE if the string ends with a repeated char run.
composed example
o1 = new stzString("banana split")
? o1.HasRepeatedTrailingChars()
#--> 0
composed from the signature, run for this page
no extension
Except
Except(pcSub): the content with all occurrences of pcSub removed.
composed example
o1 = new stzString("banana split")
? @@( o1.Except("an") )
#--> [ "b", "a split" ]
composed from the signature, run for this page
no extension
Nth(n[, pcSub]): Nth(n) : the n-th char (1-based, codepoint-aware) Nth(n, pcSub) : position of the n-th occurrence of pcSub Negative n counts from the end (-1 = last). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.Nth(2, "an")
#--> 4
composed from the signature, run for this page
QCSXTZZZIBWUSTD
NthChar1
The char at position n (lenient 1-based form).
composed example
o1 = new stzString("banana split")
? o1.NthChar1(2)
#--> a
composed from the signature, run for this page
no extension
LastNItemsQRT
(NthChar already exists earlier; just expose Nth alias above.) LastNItemsQRT(n, pcType): the last n items wrapped in pcType. stzString surface: forward to LastNChars + appropriate wrapper.
composed example
o1 = new stzString("banana split")
? o1.LastNItemsQRT(2, "an")
#--> it
composed from the signature, run for this page
no extension
FirstNItemsQRT
The first n chars, in the requested return type (QRT).
composed example
o1 = new stzString("banana split")
? o1.FirstNItemsQRT(2, "an")
#--> ba
composed from the signature, run for this page
no extension
FindLastAsSection
FindLastAsSection: [start, end] of the last occurrence of pcSub.also written: FindLasteAsSection
composed example
o1 = new stzString("banana split")
? @@( o1.FindLastAsSection("an") )
#--> [ 4, 5 ]
composed from the signature, run for this page
no extension
FindPrevious(pcSub, nFrom): mirror of NextOccurrence -- highest position strictly before nFrom. 6 examples run
o1 = new stzString("[••[•[••]•[•]]••[••]]")
? o1.FindNext("[", :StartingAt = 17)
? o1.FindPrevious("]", :StartingAt = 13)
#--> 0
#--> 9
library testno extension
The position of the nth occurrence STRICTLY BEFORE the given position. 2 examples run
composed example
o1 = new stzString("banana split")
? o1.FindPreviousNth(2, "an", 5)
#--> 2
composed from the signature, run for this page
no extension
ExtractNumbers
ExtractNumbers(): every contiguous run of digits as a list of numbers. e.g. "abc12def345" -> [12, 345].no extension
LeftCharRemoved
LeftCharRemoved / RightCharRemoved: non-mutating singular.
composed example
o1 = new stzString("banana split")
? o1.LeftCharRemoved()
#--> anana split
composed from the signature, run for this page
no extension
RightCharRemoved
A copy with the last (rightmost) char removed.
composed example
o1 = new stzString("banana split")
? o1.RightCharRemoved()
#--> banana spli
composed from the signature, run for this page
no extension
CapitalCased(): first char uppercase, rest lowercase. CapitalCased(): TITLE case -- capitalise the first letter of EVERY word (engine ToTitle), per the original. (NOT sentence-case / first-letter-only.) 1 examples run
composed example
o1 = new stzString("banana split")
? o1.CapitalCased()
#--> Banana Split
composed from the signature, run for this page
no extension
CapitalCase
Capitalize the string in place (mutating). For a copy, use CapitalCased.QCSXTZZZIBWU
IsMadeOfNumbers(): TRUE if EVERY char is a digit. 1 examples runalso written: IsMadeOfDigits
# '121212' is made of '12'
? Q("121212").IsMadeOf("12")
# '121212' is made of ['1','2']
? Q("121212").IsMadeOf([ "1", "2" ])
# '984332' is made of numbers
? Q("984332").IsMadeOfNumbers()
#--> 1
#--> 1
#--> 1
library testno extension
IsMadeOfLetters
TRUE if the string is made of letters only.
composed example
o1 = new stzString("banana split")
? o1.IsMadeOfLetters()
#--> 0
composed from the signature, run for this page
no extension
SplitToPartsOfSizes
SplitToPartsOfSizes(anSizes): split into pieces of the given sizes.no extension
IsStepNamedParam
IsStepNamedParam(): TRUE if content is [:step, value]. Used by parser narratives.no extension
UpdateWith(pcNew): replace content with pcNew. Alias of Update. 1 examples run
o1 = new stzString("999999999999")
o1.UpdateWith("999 999 999.999")
# the content becomes the new value
? o1.Content()
#--> 999 999 999.999
library testQCSXTZZZIBWU
RemoveCharFromLeft(pcChar): drop leading chars matching pcChar. 1 examples runQCSXTZZZIBWU
RemoveCharFromRight
Drop the trailing chars matching pcChar from the end of the string (mutating).QCSXTZZZIBWU
NthAsSection
ItemsAndTheirNumberOfOccurrence(): per-char occurrence count returned as [ [char, count], ... ]. NthAsSection(n, pcSub): [start, end] of the n-th occurrence of pcSub.
composed example
o1 = new stzString("banana split")
? @@( o1.NthAsSection(2, "an") )
#--> [ 4, 5 ]
composed from the signature, run for this page
no extension
LeftBound
The opening (left) bound of the string.
composed example
o1 = new stzString("banana split")
? o1.LeftBound()
#--> b
composed from the signature, run for this page
no extension
RightBound
The closing (right) bound of the string.
composed example
o1 = new stzString("banana split")
? o1.RightBound()
#--> t
composed from the signature, run for this page
no extension
CharsInverted
CharsInverted: each char's case toggled.
composed example
o1 = new stzString("banana split")
? @@( o1.CharsInverted() )
#--> [ "B", "A", "N", "A", "N", "A", " ", "S", "P", "L", "I", "T" ]
composed from the signature, run for this page
no extension
InvertCharsCase
Swap the case of every char in place (mutating, engine-backed).no extension
ToStzTable
ToStzTable: stub returning content as a single-cell table.no extension
FindNextOccurrences
IsContiguousListInString: TRUE if content roughly matches `a:b` short-form list literal. FindNextOccurrences(:Of = pcSub, :StartingAt = N): positions of every occurrence of pcSub after position N.no extension
FindPreviousOccurrences
The previous occurrence of the substring from the given start position: the position(s).no extension
TRUE if the string is a contiguous list in normal form (1:5 style). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsContiguousListInNormalForm()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a contiguous list in short form. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsContiguousListInShortForm()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string holds a contiguous list, any form. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsContiguousListInString()
#--> 0
composed from the signature, run for this page
no extension
ItemsAndTheirNumberOfOccurrence
Each char paired with how many times it occurs.
composed example
o1 = new stzString("banana split")
? @@( o1.ItemsAndTheirNumberOfOccurrence() )
#--> [ [ "b", 1 ], [ "a", 3 ], [ "n", 2 ], [ " ", 1 ], [ "s", 1 ], [ "p", 1 ], [ "l", 1 ], [ "i", 1 ], [ "t", 1 ] ]
composed from the signature, run for this page
no extension
Last3CharsAsString
The last three chars, as a string.
composed example
o1 = new stzString("banana split")
? o1.Last3CharsAsString()
#--> lit
composed from the signature, run for this page
no extension
First3CharsAsString
The first three chars, as a string.
composed example
o1 = new stzString("banana split")
? o1.First3CharsAsString()
#--> ban
composed from the signature, run for this page
no extension
Next3Chars
More codepoint convenience slices. Next3Chars(:StartingAt = n): the 3 chars AFTER position n (a LIST); Next3CharsAsString returns them as a substring.
composed example
o1 = new stzString("banana split")
? @@( o1.Next3Chars(3) )
#--> [ "a", "n", "a" ]
composed from the signature, run for this page
no extension
CharRemovedFromLeft
CharRemovedFromLeft / FromRight: non-mutating singular form. Accepts a one-arg call (param ignored) for narrative-friendly spellings like CharRemovedFromLeft("*"). CharRemovedFromLeft(c): drop ONE leading char ONLY if it equals c (no-op when c is absent). Non-mutating. The XT form strips the whole run.QCSXTZZZIBWU
CharRemovedFromRight
A copy with the trailing run of the given char dropped.QCSXTZZZIBWU
Consecutive (adjacent) substrings, per the original monolith: for each length i in 1..floor(n/2), the string is tiled from each of the i phase offsets into i-char windows (phase-major order). Across all phases that yields every window of length i, so the count per length is n-i+1 and the total is Sum(n-i+1). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStrings()
#--> 57
composed from the signature, run for this page
no extension
NumberOfConsecutiveSubStringsOf
How many CONSECUTIVE repetitions of pcSub the string holds.
composed example
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStringsOf("an")
#--> 1
composed from the signature, run for this page
no extension
ENGINE-BACKED (StzEngineStringConsecutiveSubStrings): all window tilings 1..floor(len/2). Retires the O(len^2) Haro double-loop. 2 examples run
oA = new stzString("a")
s = new stzString( oA.Repeated(1000) )
# ConsecutiveSubStrings count is 375,250
? len(s.ConsecutiveSubStrings())
# FindDupSecutiveChars is 999 (positions 2..1000)
? len(s.FindDupSecutiveChars())
#--> 375250
#--> 999
library testQCSXTZZZIBWU
FindConsecutiveSubStrings
The original Find form returns the UNIQUE per-length indices, which reduce to [1..n] (the length-1 row alone spans them all).
composed example
o1 = new stzString("banana split")
? @@( o1.FindConsecutiveSubStrings() )
#--> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
composed from the signature, run for this page
QCSXTZZZIBWU
Same as ShortenedXT: ShortenedXT(nLeft, nRight, pcEllipsis): keep nLeft chars from the start and nRight from the end, with pcEllipsis between. A 0 left count mirrors the right (the symmetric default). 1 examples run
# ShortenedUsing(' {...} ') keeps 3 each side
? Q("1234567890987654321").ShortenedUsing(" {...} ")
# ShortenedNUsing(5, ' {...} ') keeps 5 each side
? Q("1234567890987654321").ShortenedNUsing(5, " {...} ")
#--> 123 {...} 321
#--> 12345 {...} 54321
library testno extension
BoundsRemoved(): drop the auto-detected leading + trailing non-letter bounds. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.BoundsRemoved()
#--> anana spli
composed from the signature, run for this page
QCSXTZZZIBWU
NumberOfConsecutiveSubStringsOfNChars
How many consecutive n-char chunks the string splits into.
composed example
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStringsOfNChars(2)
#--> 11
composed from the signature, run for this page
no extension
Unspacify(): trim, then collapse each run of 2+ spaces to one (the original monolith: Trim + remove dup-consecutive spaces). 1 examples run
o1 = new stzString(" so ftan   za ")
o1.Unspacify()
# edges trimmed, the 3-space run collapsed
? o1.Content()
#--> so ftan za
library testQCSXTZZZIBWU
A copy with the spaces removed; the original is unchanged. 3 examples run
# "r  in  g " -> "r in g"
? Q("r  in  g ").Unspacified()
# "    r  in  g " -> "r in g"
? Q("    r  in  g ").Unspacified()
#--> r in g
#--> r in g
library testno extension
The position of the nth occurrence of pcSub after the given position (0 when there is none). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.FindNthNext(2, "an", 5)
#--> 0
composed from the signature, run for this page
no extension
FindNthPrevious / FindNthNext on stzString. 3 examples run
o1 = new stzString("12♥4♥67")
# previous from 5
? o1.FindPrevious("♥", :StartingAt = 5)
# 2nd previous from 6
? o1.FindNthPrevious(2, "♥", :StartingAt = 6)
#--> 3
#--> 3
library testno extension
FirstZ
FirstZ(sub) -- the Z grouping [sub, position] of the first occurrence (0-arg keeps the first-char section form).
composed example
o1 = new stzString("banana split")
? @@( o1.FirstZ("an") )
#--> [ "an", 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
LastZ
The last char along with its position.
composed example
o1 = new stzString("banana split")
? @@( o1.LastZ() )
#--> [ 12, 12 ]
composed from the signature, run for this page
no extension
VizFind / VizFindCSXT / VizFindXT -- visualization (returns a rendered string showing match positions). Provisional: just return the content with matched chars highlighted via ASCII. 3 examples run
# four carets on the rail
? StzStringQ("ABTCADNBBABEFACCC").VizFind("A")
#--> ABTCADNBBABEFACCC
#--> ^---^----^---^---
library testQCSXTZZZIBWUMany
ConsecutiveSubStringsOfNChars
SectionsOfSameItems already defined as method; expose as alias in case test calls a slightly different spelling. ConsecutiveSubStringsOfNChars(n) -- value form: the substrings (not just count) that appear consecutively. ConsecutiveSubStringsOfNChars(n): the n-char windows obtained by tiling the string from each of the n phase offsets (phase-major), per the original monolith. ENGINE-BACKED (StzEngineStringConsecutiveSubStringsOfN): phase-major window tiling of n codepoints. Retires the O(len) Haro double-loop.
composed example
o1 = new stzString("banana split")
? @@( o1.ConsecutiveSubStringsOfNChars(2) )
#--> [ "ba", "na", "na", " s", "pl", "it", "an", "an", "a ", "sp", "li" ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindNthAsSection
FindNthAsSection(n, pcSub): [start, end] of the n-th occurrence.
composed example
o1 = new stzString("banana split")
? @@( o1.FindNthAsSection(2, "an") )
#--> [ 4, 5 ]
composed from the signature, run for this page
no extension
NthStz
NthStz(n[, pcSub, :StartingAt = N]): 1-arg : the n-th char wrapped in stzChar 3-arg : start position of n-th occurrence of pcSub, optionally from a given position
composed example
o1 = new stzString("banana split")
? @@( o1.NthStz(2, "an", 2) )
#--> [ "an", 4 ]
composed from the signature, run for this page
no extension
FindNthSZZ
The nth occurrence of the substring from the given start position, as [start, end] section(s).
composed example
o1 = new stzString("banana split")
? @@( o1.FindNthSZZ(2, "an", 2) )
#--> [ "an", [ 4, 5 ] ]
composed from the signature, run for this page
no extension
FirstSTDZ
FirstSTDZ(pcSub, nStartAt, pDir): pos only (no section). The STDZ/STDZZ forms carry the [sub, pos] / [sub, span] grouping.
composed example
o1 = new stzString("banana split")
? @@( o1.FirstSTDZ("an", 2, :Forward) )
#--> [ "an", 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
CharsInSection
CharsInSection(n1, n2): the chars in the [n1, n2] section as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.CharsInSection(2, 5) )
#--> [ "a", "n", "a", "n" ]
composed from the signature, run for this page
no extension
ReplaceInSections
ReplaceInSections(aSections, pcOld, pcNew): apply Replace only inside the given sections. Walks sections descending so positions stay valid.QCSXTZZZIBWU
ReplaceCharsWXT(pcCondition, pcNewChar): replace every char matching the predicate with pcNewChar. Engine-backed walk. 2 examples run
composed example
o1 = new stzString("banana split")
o1.ReplaceCharsW("@char = 'a'", "AN")
? o1.Content()
#--> bANnANnAN split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceEachLeadingChar(pcNewChar): replace every leading run char with pcNewChar. 2 examples run
composed example
o1 = new stzString("banana split")
o1.ReplaceEachLeadingChar("AN")
? o1.Content()
#--> ANanana split
composed from the signature, run for this page
QCSXTZZZIBWU
Replace EACH char of the trailing run with the given char (mutating). 2 examples run
composed example
o1 = new stzString("banana split")
o1.ReplaceEachTrailingChar("AN")
? o1.Content()
#--> banana spliAN
composed from the signature, run for this page
QCSXTZZZIBWU
Same as ReplaceEachLeadingChar: ReplaceEachLeadingChar(pcNewChar): replace every leading run char with pcNewChar. 1 examples run
composed example
o1 = new stzString("banana split")
o1.ReplaceEachLeadingAndTrailingChar("AN")
? o1.Content()
#--> ANanana spliAN
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceSubStringsWithMarquers
ReplaceSubStringsWithMarquers: turn the listed substrings INTO their ordinal marquers (#1, #2, ...) -- the inverse of ReplaceMarquers.
composed example
o1 = new stzString("banana split")
o1.ReplaceSubStringsWithMarquers([ "an", "a" ])
? o1.Content()
#--> b#1#1#2 split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceSubStringsWithMarkers
Same as ReplaceSubStringsWithMarquers: ReplaceSubStringsWithMarquers: turn the listed substrings INTO their ordinal marquers (#1, #2, ...) -- the inverse of ReplaceMarquers.
composed example
o1 = new stzString("banana split")
o1.ReplaceSubStringsWithMarkers([ "an", "a" ])
? o1.Content()
#--> b#1#1#2 split
composed from the signature, run for this page
no extension
UnicodeDataAsStringEmpty
UnicodeDataAsString() and MarquersPositions(): missing globals called inside the test scripts. We make them top-level stubs so the R3 misses resolve. The full UnicodeDataAsString returns the entire Unicode database as a string (engine call); for now we return "" so the test load completes -- it's only used by perf-comparison narratives.no extension
LastSTDZ
LastSTDZ / LastSTDZZ: positional / sectional last-occurrence directional search from a starting position.
composed example
o1 = new stzString("banana split")
? @@( o1.LastSTDZ("an", 2, :Forward) )
#--> [ "an", 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindOccurrences
FindOccurrences(pcSub | anN, :Of = pcSub): all positions, or select positions of nth-occurrences from a list.also written: FindAllOccurrences · FindTheseOccurrences · FindTheseOccurrencesAsSQCSXTZZZIBWUSTD
FindTheseOccurrencesSD
FindTheseOccurrencesSD(anN, :Of=pcSub, :StartingAt=N, pDir): typo-tolerant alias accepting optional :StartingAt.QCSXTZZZIBWU
NthStzS
NthStzS(n, pcSub[, :StartingAt = N]): start position of the n-th occurrence of pcSub, optionally starting from a given position. (Spelled NthStzS to avoid case-insensitive collision with NthStz.)
composed example
o1 = new stzString("banana split")
? o1.NthStzS(2, "an", 2)
#--> 4
composed from the signature, run for this page
QCSXTZZZIBWU
Next3CharsAsString
The three chars after the given position, as a string.
composed example
o1 = new stzString("banana split")
? o1.Next3CharsAsString(3)
#--> ana
composed from the signature, run for this page
no extension
FirstStz
FirstStz / LastStz: the [sub, position] grouping of the first / last occurrence at or after :StartingAt (the S = starting-at family is forward-looking).
composed example
o1 = new stzString("banana split")
? @@( o1.FirstStz("an", 2) )
#--> [ "an", 2 ]
composed from the signature, run for this page
no extension
LastStz
The last occurrence: the substring paired with its position, from the given start position (an empty list when there is no match).
composed example
o1 = new stzString("banana split")
? @@( o1.LastStz("an", 2) )
#--> [ "an", 4 ]
composed from the signature, run for this page
no extension
CharTrimmedFromLeft
Same as CharRemovedFromLeftXT: CharRemovedFromLeft / FromRight: non-mutating singular form. Accepts a one-arg call (param ignored) for narrative-friendly spellings like CharRemovedFromLeft("*"). CharRemovedFromLeft(c): drop ONE leading char ONLY if it equals c (no-op when c is absent). Non-mutating. The XT form strips the whole run. (extended form: takes an options list)no extension
CharTrimmedFromRight
Same as CharRemovedFromRightXT: A copy with the trailing run of pcChar dropped; the original is unchanged.no extension
FindLastSZZ
The SZZ forms group [sub, [start, end]] (per the original archive: FindLastSZZ("♥♥♥", :StartingAt = 6) --> [ "♥♥♥", [13, 15] ]).
composed example
o1 = new stzString("banana split")
? @@( o1.FindLastSZZ("an", 2) )
#--> [ "an", [ 4, 5 ] ]
composed from the signature, run for this page
no extension
FindFirstSZZ
The first occurrence of the substring from the given start position, as [start, end] section(s).
composed example
o1 = new stzString("banana split")
? @@( o1.FindFirstSZZ("an", 2) )
#--> [ "an", [ 2, 3 ] ]
composed from the signature, run for this page
no extension
FindTheseOccurrencesAsSections
The [start, end] sections of the chosen occurrence numbers (:Of = sub).QCSXTZZZIBWUSTD
TheseSubstringsZ
TheseSubstringsZ(pacSubStr): start positions of any listed substring's first occurrence. TheseSubstringsZ([subs]): each substring grouped with ALL its positions -- [ [sub, [positions]], ... ].
composed example
o1 = new stzString("banana split")
? @@( o1.TheseSubstringsZ([ "an", "a" ]) )
#--> [ [ "an", [ 2, 4 ] ], [ "a", [ 2, 4, 6 ] ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitAroundCS_named
(FindAntiSectionsZZ already exists earlier; the FindExceptZZ helper above covers the gap-sections semantic.) SplitAroundCS(pcSub, pCaseSensitive): like SplitAround but tolerant of named-param :CS = bCase.no extension
SubStringXT(p1, p2): polymorphic substring DSL. SubStringXT(n, :NCharsFrom = m) -- m chars from pos n SubStringXT(pcSub, :NCharsFrom = m) -- m chars after pcSub SubStringXT(:NCharsBefore = m, pcSub) -- m chars before pcSub 1 examples run
# the named-param shape is recognised
? Q(:IsBoundedBy = ".").IsIsBoundedByNamedParam()
# the direct check
? Q(".♥.").SubStringIsBoundedBy("♥", ".")
# the SubStringXT spelling
? Q(".♥.").SubStringXT("♥", :IsBoundedBy = ".")
#--> 1
#--> 1
#--> 1
library testno extension
IsIsBoundedByNamedParam
IsIsBoundedByNamedParam: predicate on the content list for the :IsBoundedBy named-param shape. Returns TRUE iff content is a 2-elem list [:IsBoundedBy, ...].no extension
CommonItems
CommonItems(:With = pcOther): same idea as CommonSubStrings but at the CHAR level (intersection of char sets).no extension
FindConsecutiveSubStringsOfNChars(n): positions of each back-to-back n-char identical pair. RemoveNthChar(n): remove the char at codepoint position n. Accepts :First / :Last / :Middle symbolic positions. 2 examples run
o1 = new stzString("125.450")
o1.RemoveNthChar(7)
# the 7th char is gone
? o1.Content()
#--> 125.45
library testQCSXTZZZIBWU
AntiFind
Antifind on stzString: synonyms of AntiFindAsSections / AntiFind. AntiFind(pcSub) here returns the positions of every char that is NOT inside pcSub's occurrences -- the complement walk.
composed example
o1 = new stzString("banana split")
? @@( o1.AntiFind("an") )
#--> [ 1, 6, 7, 8, 9, 10, 11, 12 ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitAroundCSNamed
SplitAroundCS alias delegating to existing.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAroundCSNamed("an", 2) )
#--> [ "b", "", "a split" ]
composed from the signature, run for this page
no extension
>= n occurrences (canonical + misspelled alias) 1 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.SubStringsOccuringNTimes(2) )
#--> [ "a", "an", "n", "na" ]
composed from the signature, run for this page
no extension
= n occurrences The substrings occurring EXACTLY n times. 1 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringOnlyNTimes(2) )
#--> [ "an", "n", "na" ]
composed from the signature, run for this page
no extension
YieldCharsW(pcYielder, pNamedWhere): transform every char through the yielder expression via the engine char-map (StzEngineStringMapChars, expr.zig -- no eval). Optional :Where = predicate restricts to the matching chars first (engine FindCharsW). @char binding. Replaces the retired raw-eval YieldCharsWXT. 1 examples run
# FindCharsW reports the letter positions
? @@( Q("..ONE...TWO..").FindCharsW('isLetter(@char)') )
# YieldCharsW with :Where collects the letters
? @@( Q("..ONE...TWO..").YieldCharsW('@char', :Where = 'isLetter(@char)') )
#--> [ 3, 4, 5, 9, 10, 11 ]
#--> [ "O", "N", "E", "T", "W", "O" ]
library testno extension
SplitToPartsOfNChars
SplitToPartsOfNChars(n): split into pieces of EXACTLY n chars -- a shorter trailing remainder is DROPPED (the XT form keeps it).also written: SplitToPartsOfExactlyNChars
composed example
o1 = new stzString("banana split")
? @@( o1.SplitToPartsOfNChars(2) )
#--> [ "ba", "na", "na", " s", "pl", "it" ]
composed from the signature, run for this page
QCSXTZZZIBWU
NextNChars
PreviousNChars / NextNChars: the n chars before / after the first occurrence of a delimiter substring.also written: NextNItems
composed example
o1 = new stzString("banana split")
? o1.NextNChars("an", 2)
#--> an
composed from the signature, run for this page
no extension
PreviousNChars
The n chars before the given anchor (position or substring).also written: PreviousNItems
composed example
o1 = new stzString("banana split")
? o1.PreviousNChars("an", 2)
#--> b
composed from the signature, run for this page
no extension
FindNumbers
FindNumbers(): start positions of every (sign- and decimal-aware) number -- derived from the same sections Numbers() uses.QCSXTZZZIBWU
UniqueNumbers
UniqueNumbers(): the distinct numbers in the content. Uses Numbers() (NOT ExtractNumbers, which now mutates by removing them).no extension
SubStringsOccurringExactlyNTimes
The substrings occurring EXACTLY n times.
composed example
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringExactlyNTimes(2) )
#--> [ "an", "n", "na" ]
composed from the signature, run for this page
no extension
SubStringsOccurringNTimes
The substrings occurring AT LEAST n times.
composed example
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringNTimes(2) )
#--> [ "a", "an", "n", "na" ]
composed from the signature, run for this page
no extension
NumbrifyQ
NumbrifyQ / NumbrifiedQ: alias for ToNumber wrap.also written: NumbrifiedQno extension
TRUE if the string starts with the given number (prefix equality). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.StartsWithThisNumber("an")
#--> 0
composed from the signature, run for this page
no extension
SplitToPartsOfNCharsXTOpt
Split into n-char parts with options (keep-remainder form).
composed example
o1 = new stzString("banana split")
? @@( o1.SplitToPartsOfNCharsXTOpt(2, 5) )
#--> [ "ba", "na", "na", " s", "pl", "it" ]
composed from the signature, run for this page
no extension
NumbersAndTheirPositions
Same as NumbersZ: The numbers embedded in the string, each with its position.no extension
NumbersAndTheirSections
Same as NumbersZZ: The numbers embedded in the string, each with its [start, end] section.no extension
NthNumberComingAfter
NthNumberComingAfter(n, pcAnchor): the n-th number after pcAnchor.
composed example
o1 = new stzString("banana split")
? o1.NthNumberComingAfter(2, "an")
#--> 0
composed from the signature, run for this page
no extension
IsNotLetter() -- TRUE if This is NOT a single letter char. (IsLetter already exists above; just add the negation.) 1 examples run
# * is not a letter, computationally
? NOT Q("*").IsLetter()
# ... and linguistically
? Q("*").IsNotLetter()
#--> 1
#--> 1
library testno extension
IsAtCharsNamedParam
IsAtCharsNamedParam(): TRUE iff content is [:AtChars, value]. We're a string -> always FALSE.no extension
SplitAroundPositions(anPos): split at each position; the delimiter char at each position becomes its own piece. SplitAroundPositions(anPos): the pieces between the positions (the chars AT the positions are dropped). 1 examples run
# the pieces between the positions remain
? @@( Q("---4---8---").SplitAroundPositions([ 4, 8 ]) )
#--> [ "---", "---", "---" ]
library testno extension
IsPluralOfThisStzType(pcType): TRUE if content is the plural form of pcType (i.e. equal to pcType + "s"). 1 examples run
# stzchars is a plural of a stz type
? Q("stzchars").IsPluralOfAStzType()
# ... specifically of stzchar
? Q("stzchars").IsPluralOfThisStzType("stzchar")
#--> 1
#--> 1
library testno extension
InfereMethod(:From = :stzClass): infer the predicate method the given class offers for THIS string -- "is" + string, else "is" + string-minus-final-s (per the original monolith). E.g. Q("punctuation").InfereMethod(:From = :stzChar) -> "ispunctuation". 1 examples run
# punctuation infers its checker
? Q("punctuation").InfereMethod(:From = :stzChar)
# the plural falls back to the singular
? Q("punctuations").InfereMethod(:From = :stzChar)
#--> ispunctuation
#--> ispunctuation
library testno extension
DuplicatedCharsRemoved
A copy with the duplicated chars removed; the original is unchanged.
composed example
o1 = new stzString("banana split")
? o1.DuplicatedCharsRemoved()
#--> ban split
composed from the signature, run for this page
no extension
A stzString IS a string (stzChar answers TRUE via its own def). 1 examples run
# a stzString is a string
? StzStringQ("s").IsString()
# a stzChar is a string too
? StzCharQ("s").IsString()
#--> 1
#--> 1
library test · written IsAString() in the library today: the host language already holds IsString(), and Haro removes the detourno extension
IsAFunction: is the content the name of a DEFINED function (per the original monolith: functions() lookup)? The call-looking check is IsAlmostAFunctionCall. 1 examples runalso written: IsFunc · IsAFunctionName
# stzLen is a function
? Q("stzLen").IsFunction()
# stzChar is a class
? Q("stzChar").IsClass()
#--> 1
#--> 1
library test · written IsAClass() in the library today: the host language already holds IsClass(), and Haro removes the detour; written IsAFunction() in the library today: the host language already holds IsFunction(), and Haro removes the detourno extension
IsAnInteger
TRUE if the string is an integer literal (trimmed).also written: IsInteger
composed example
o1 = new stzString("banana split")
? o1.IsAnInteger()
#--> 0
composed from the signature, run for this page
no extension
FindSpaces
FindSpaces() / FindEmptyStrings(): positions of every " ".also written: FindEmptyStrings
composed example
o1 = new stzString("banana split")
? @@( o1.FindSpaces() )
#--> [ 7 ]
composed from the signature, run for this page
no extension
Check([pcExpr]) -- evaluate pcExpr per char (@char in scope) and return TRUE if it holds for every char. 0-arg form is the existence-check stub used by re-include narratives. 2 examples run
? Q("(,,)").Check(:That = 'StzCharQ(@Char).IsPunctuation()')
#--> 1
library testno extension
SubStringsOccurringLessThanNTimes
The substrings occurring fewer than n times.also written: SubStringsOccurringNoMoreThanNTimesno extension
Removed
A copy of the string with every occurrence of pcWhat removed; the original is unchanged.
composed example
o1 = new stzString("banana split")
? o1.Removed("an")
#--> ba split
composed from the signature, run for this page
no extension
IsBoundOfXT
IsBoundOfXT(:Open=, :Close=) -- TRUE iff the content equals one of the bounds (i.e. it IS the opening or closing string).
composed example
o1 = new stzString("banana split")
? o1.IsBoundOfXT(2, 5)
#--> 0
composed from the signature, run for this page
no extension
IsAClass(): TRUE if content is a Haro class name (lookup via Haro's classes() introspection). 1 examples run
# stzLen is a function
? Q("stzLen").IsFunction()
# stzChar is a class
? Q("stzChar").IsClass()
#--> 1
#--> 1
library test · written IsAClass() in the library today: the host language already holds IsClass(), and Haro removes the detour; written IsAFunction() in the library today: the host language already holds IsFunction(), and Haro removes the detourno extension
Combinations
Combinations(n): every n-char combination from the content.no extension
IsNotAString
IsNotAString(): TRUE iff content is NOT a string. We're a stzString -- always FALSE.
composed example
o1 = new stzString("banana split")
? o1.IsNotAString()
#--> 0
composed from the signature, run for this page
no extension
AreBoundsOfXT
AreBoundsOfXT(:Open=, :Close=): TRUE iff THIS contains both bounds; the IsBoundOfXT predicate flipped to "we contain something bounded by these".
composed example
o1 = new stzString("banana split")
? o1.AreBoundsOfXT(2, 5)
#--> 0
composed from the signature, run for this page
no extension
RandomPositionAfter
RandomPositionAfter(nFrom): a random codepoint position strictly after nFrom (inclusive of the last position).no extension
ContainsMoreThenN(n, pcSub) or (pcSub, n): TRUE iff content contains pcSub strictly more than n times. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsMoreThenN("an", 2)
#--> 0
composed from the signature, run for this page
no extension
ContainsMoreThanN
TRUE if pcSub occurs MORE than n times.
composed example
o1 = new stzString("banana split")
? o1.ContainsMoreThanN("an", 2)
#--> 0
composed from the signature, run for this page
no extension
ContainsAtLeastN
TRUE if pcSub occurs at least n times.
composed example
o1 = new stzString("banana split")
? o1.ContainsAtLeastN("an", 2)
#--> 1
composed from the signature, run for this page
no extension
ContainsExactlyN
TRUE if pcSub occurs exactly n times.
composed example
o1 = new stzString("banana split")
? o1.ContainsExactlyN("an", 2)
#--> 1
composed from the signature, run for this page
no extension
IsMarquer
IsMarquer / IsMarker: TRUE iff content is a "#N" marker token.also written: IsMarker
composed example
o1 = new stzString("banana split")
? o1.IsMarquer()
#--> 0
composed from the signature, run for this page
no extension
NumberOfEmptyLines
NumberOfEmptyLines(): count blank lines (after trim).
composed example
o1 = new stzString("banana split")
? o1.NumberOfEmptyLines()
#--> 0
composed from the signature, run for this page
no extension
NumberOfNonEmptyLines
How many non-empty lines the string holds.
composed example
o1 = new stzString("banana split")
? o1.NumberOfNonEmptyLines()
#--> 1
composed from the signature, run for this page
no extension
BoundsUpToNChars
The string's bounds, capped to n chars each.no extension
Move(n1, n2): move char from position n1 to position n2. Accepts named-param form Move(:CharFromPosition = N, :To = M). 1 examples run
composed example
o1 = new stzString("banana split")
o1.Move(2, 5)
? o1.Content()
#--> bnaana split
composed from the signature, run for this page
QCSXTZZZIBWU
Swap(n1, n2): swap chars at positions n1 and n2. Also accepts Swap(:Positions = n1, :And = n2) and Swap(pcA, :And = pcB) to swap two substrings. 2 examples run
o1 = new stzString("TWO, ONE, THREE!")
o1.Swap("TWO", :And = "ONE")
# the words traded places
? o1.Content()
#--> ONE, TWO, THREE!
library testQCSXTZZZIBWU
NthToLast(n): the n-th-to-last char ("1st to last" = last). NthToLast(n): the char at position len - n (the original: CharAtPosition(NumberOfChars() - n)). 1 examples run
# SOFTANZA's 3rd-to-last is A
? Q("SOFTANZA").NthToLast(3)
#--> A
library testno extension
IsListInNormalForm(): TRUE iff content parses as a Haro list literal in normal form (square-bracketed, comma-separated). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsListInNormalForm()
#--> 0
composed from the signature, run for this page
no extension
UniqueSubStringsBoundedBy
Same as SubStringsBoundedByU: SubStringsBoundedByU: the UNIQUE bounded substrings ("U" = unique, not case-insensitive -- the settled Z/U convention).no extension
Positions
Positions(pcSub): all positions of pcSub (alias of AllPositionsOf; accepts the :Of / :OfSubString named spelling).also written: FindPositions
composed example
o1 = new stzString("banana split")
? @@( o1.Positions("an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
no extension
FindNthBoundedBy
FindNthBoundedBy(n, pacBounds, pcSub): position of the n-th occurrence of pcSub inside any bounded section.
composed example
o1 = new stzString("banana split")
? o1.FindNthBoundedBy(2, [ "an", "a" ], "an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
Ranges
Ranges([aRanges]): contiguous-character ranges, or section-text extraction when given a list of [start, count] ranges. Test 543: o1.Ranges([[1,2],[8,3],...]) -> sliced sections.
composed example
o1 = new stzString("banana split")
? @@( o1.Ranges(3) )
#--> [ [ "b", "b" ], [ "a", "a" ], [ "n", "n" ], [ "a", "a" ], [ "n", "n" ], [ "a", "a" ], [ " ", " " ], [ "s", "s" ], [ "p", "p" ], [ "l", "l" ], [ "i", "i" ], [ "t", "t" ] ]
composed from the signature, run for this page
no extension
RemoveBoundedSubString(pacBounds): remove the entire bounded section (including bounds) of the FIRST match. RemoveBoundedSubString(pcSub): remove the BOUNDED occurrences of pcSub (their content only -- the bounds stay); a 2-list keeps the legacy remove-first-region-with-bounds behavior. 1 examples run
o1 = new stzString("bla word bla <<word>> bla bla <<word>> bla <<word>> word")
o1.RemoveBoundedSubString("word")
# only the bounded contents vanish
? o1.Content()
#--> bla word bla <<>> bla bla <<>> bla <<>> word
library testQCSXTZZZIBWU
RemoveAnySubStringBoundedBy: remove every bounded region's CONTENT (the bounds stay); the IB form removes bounds too. 2 examples run
o1 = new stzString("bla bla <<word>> bla bla <<noword>> bla <<word>>")
o1.RemoveAnySubStringBoundedBy([ "<<", ">>" ])
# the shells remain
? o1.Content()
#--> bla bla <<>> bla bla <<>> bla <<>>
library testQCSXTZZZIBWU
SubStringBounds
SubStringBounds(pcSub): the FLAT bound-run SUBSTRINGS of every bounded occurrence (left then right, in order) -- ["<<", ">>", "<<", ">>", ...].
composed example
o1 = new stzString("banana split")
? @@( o1.SubStringBounds("an") )
#--> [ "b", "a", "n", "a" ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindTheseSubStringBounds
FindTheseSubStringBounds(pcSub|pacSubStr [, pacBounds]): - 1-arg list: per substring, the [before, after] single-char bounds - 2-arg (string, list): the bounds of pcSub when found inside any of the explicit pacBounds [open, close] pair FindTheseSubStringBounds(pcSub, [open, close]): the FLAT start positions of the open/close tokens IMMEDIATELY around each occurrence of pcSub (only exactly-bounded occurrences count).QCSXTZZZIBWU
IsRightToLeft
NRightCharsAsSubString(n) / NLeftCharsAsSubString(n). For a right-to-left string the VISUAL right is the string START (per the original NRightCharsAsSubString: IsRightToLeft -> the leading codepoints).
composed example
o1 = new stzString("banana split")
? o1.IsRightToLeft()
#--> 0
composed from the signature, run for this page
no extension
The n rightmost chars, direction-aware, as a string. 1 examples run
o1 = new stzString("هذه الكلمات الّتي سوف تبقى")
# the right 4 chars open the text
? o1.NRightCharsAsSubstring(4)
o1.RemoveFromRight("هذه ")
# removing from the right trims the start
? o1.Content()
#--> هذه
#--> الكلمات الّتي سوف تبقى
library testno extension
NLeftCharsAsSubString
The n leftmost chars, direction-aware, as a string.
composed example
o1 = new stzString("banana split")
? o1.NLeftCharsAsSubString(2)
#--> ba
composed from the signature, run for this page
no extension
RemoveNthOccurrence(n, pcSub): remove the n-th occurrence of pcSub. RemoveNthOccurrence(n, pcSub): remove the n-th occurrence of pcSub; n may be the symbols :First / :Last. 2 examples run
o1 = new stzString("**A1****A2***A3")
o1.RemoveNthOccurrence(:Last, "A")
# the third A is gone
? o1.Content()
#--> **A1****A2***3
library testQCSXTZZZIBWU
AddBounds([pcOpen, pcClose]): wrap content with bounds. 1-arg list form accepted: AddBounds(["<<", ">>"]). 1 examples run
o1 = new stzString("word")
o1.AddBounds(["<<",">>"])
# bounded
? o1.Content()
#--> <<word>>
library testQCSXTZZZIBWU
BoundWith
Same as AddBounds: AddBounds([pcOpen, pcClose]): wrap content with bounds. 1-arg list form accepted: AddBounds(["<<", ">>"]).QCSXTZZZIBWU
Same as BeginsWithOneOfTheseCS: (FirstBoundsOf / LastBoundsOf live next to BoundsOf above.) BeginsWithOneOfTheseCS(pacSubStr, pCaseSensitive): TRUE if the content starts with any of the listed substrings. 1 examples runalso written: StartsWithOneOfThese
composed example
o1 = new stzString("banana split")
? o1.BeginsWithOneOfThese([ "an", "a" ])
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
StartsWithEither
Same as StartsWithEitherCS: The second argument arrives as the pair [ :Or, "..." ]; a bare string is accepted too.also written: BeginsWithEitherQCSXTZZZIBWU
EndsWithOneOfThese
Same as EndsWithOneOfTheseCS: TRUE if the string ends with ANY of the given suffixes.
composed example
o1 = new stzString("banana split")
? o1.EndsWithOneOfThese([ "an", "a" ])
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
HasCentralChar(): TRUE iff content length is odd. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.HasCentralChar()
#--> 0
composed from the signature, run for this page
no extension
The middle char of the string (odd lengths). 1 examples runno extension
IsMultipleOf(pcUnit): TRUE iff content is pcUnit repeated. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsMultipleOf("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
Marquer
Marquer / Marker: the FIRST marker number. Marquer(): the marquer SYMBOL itself.also written: Marker
composed example
o1 = new stzString("banana split")
? o1.Marquer()
#--> #
composed from the signature, run for this page
no extension
ContainsMarquers
TRUE if the string contains marquers.also written: ContainsMarkers
composed example
o1 = new stzString("banana split")
? o1.ContainsMarquers()
#--> 0
composed from the signature, run for this page
no extension
IsIncludedIn
TRUE if the string occurs inside the given one.also written: IncludedIn
composed example
o1 = new stzString("banana split")
? o1.IsIncludedIn("an")
#--> 1
composed from the signature, run for this page
no extension
ReplaceSubStringAtPositions
ReplaceSubStringAtPositions(anPos, pcOld, pcNew). pcNew accepts :By = "..." named-param form.
composed example
o1 = new stzString("banana split")
o1.ReplaceSubStringAtPositions([ 1, 2 ], "an", "AN")
? o1.Content()
#--> bANana split
composed from the signature, run for this page
QCSXTZZZIBWU
Sort the marquers in descending order (mutating). 1 examples runno extension
SortMarkersInDescending
Same as SortMarquersInDescending: Sort the marquers in descending order (mutating).no extension
Sort the marquers in ascending order (mutating). 1 examples runno extension
SortMarkersInAscending
Same as SortMarquersInAscending: Sort the marquers in ascending order (mutating).no extension
MarquersSortedInDescendingZZ
MarquersSortedInDescendingZZ: the sorted marquers ZIPPED onto the text-order slots (the ZZ view of the would-be sorted string).no extension
MarquersAndPositions
Same as MarquersZ: MarquersZ: each marquer grouped with its start position.no extension
NFirstOccurrences
NFirstOccurrences(n, :Of = pcSub): the first n positions of pcSub.QCSXTZZZIBWUST
LastNOccurrences
The positions of the LAST n occurrences.QCSXTZZZIBWUST
NLastOccurrencesST
NLastOccurrencesST: the stzString spelling of the abstract stzObject form (whose SectionQ pipeline can't take symbols).no extension
MarquersAndSections
Each marquer paired with its [start, end] section.also written: MarkersAndSectionsno extension
ReplaceOccurrencesByMany
ReplaceOccurrencesByMany: (pcSubStr, paReplacements) : alias of ReplaceByMany (anN, pcSubStr, :By = paReplacements) : replace n-th selected occurrences with each replacement in turnQCSXTZZZIBWU
MarkTheseSubStringsCS
MarkTheseSubStringsCS: wrap each occurrence in [|...|]. MarkTheseSubStringsCS: replace each listed substring with its ordinal marquer #1, #2, ... (aka ReplaceSubstringsWithMarquersCS).no extension
Remove every occurrence of the given char (mutating). 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveChar(2)
? o1.Content()
#--> bnana split
composed from the signature, run for this page
QCSXTZZZIBWU
A copy with the given char removed everywhere. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.CharRemoved(2)
#--> bnana split
composed from the signature, run for this page
no extension
Remove the char at position n only if it equals pcChar (mutating). 1 examples runQCSXTZZZIBWU
TRUE if the chars are in ascending order. 2 examples run
# is ascending
? Q("01233445679").IsSortedInAscending()
# not descending
? Q("01233445679").IsSortedInDescending()
#--> 1
#--> 0
library testno extension
TRUE if the chars are in descending order. 3 examples run
# is ascending
? Q("01233445679").IsSortedInAscending()
# not descending
? Q("01233445679").IsSortedInDescending()
#--> 1
#--> 0
library testno extension
RemoveManySections
Remove the chars of each given [start, end] section (mutating).QCSXTZZZIBWU
Replace the nth occurrence AFTER the given position (mutating). 1 examples run
o1 = new stzString( "----@@--@@-------@@----@@---")
o1.ReplaceNextNthOccurrence(2, :Of = "@@", :StartingAt = 12, :With = "##")
# the 2nd @@ after 12 became ##
? o1.Content()
#--> ----@@--@@-------@@----##---
library testQCSXTZZZIBWU
Replace the nth occurrence BEFORE the given position (mutating). 1 examples run
o1 = new stzString( "----@@--@@-------@@----@@---")
o1.ReplacePreviousNthOccurrence(2, :Of = "@@", :StartingAt = 22, :With = "##")
# the 2nd @@ before 22 became ##
? o1.Content()
#--> ----@@--##-------@@----@@---
library testQCSXTZZZIBWU
TRUE if the string is the lowercase form of the given one. 2 examples run
# in itself
? Q("date").IsLowercase()
# ... and of DATE
? Q("date").IsLowercaseOf("DATE")
#--> 1
#--> 1
library testQCSXTZZZIBWU
TRUE if the string is the uppercase form of the given one. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsUppercaseOf("an")
#--> 0
composed from the signature, run for this page
no extension
UppercasedInLocale
UppercasedInLocale / LowercasedInLocale -- locale-neutral fallback.
composed example
o1 = new stzString("banana split")
? o1.UppercasedInLocale("an")
#--> BANANA SPLIT
composed from the signature, run for this page
no extension
The string lowercased for the given locale (plain lowercase fallback). 2 examples run
# DER FLUSS lowers to der fluss
? Q("DER FLUSS").LowercasedInLocale("de-DE")
# the eszett round-trip stays FALSE (documented limitation)
? Q("der fluß").IsLowercaseOfXT("DER FLUSS", :InLocale = "de-DE")
#--> der fluss
#--> 0
library testno extension
The case of the single-char string (codepoint-aware). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.CharCase()
#--> mixed
composed from the signature, run for this page
no extension
CountInSections
How many occurrences of pcSub fall inside the given sections.also written: NumberOfOccurrencesInSections
composed example
o1 = new stzString("banana split")
? o1.CountInSections("an", [ "an", "a" ])
#--> 0
composed from the signature, run for this page
no extension
Splits
Splits([pcSep]): split-on-separator words; 0-arg uses whitespace.
composed example
o1 = new stzString("banana split")
? @@( o1.Splits(" ") )
#--> [ "banana", "split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveRanges
Remove the chars of each given [start, range] slice (mutating).QCSXTZZZIBWU
RemoveTheseSubStringBounds
RemoveTheseSubStringBounds(pcSub, pacBounds): strip the bounds surrounding every occurrence of pcSub inside the bounded regions.
composed example
o1 = new stzString("banana split")
o1.RemoveTheseSubStringBounds("an", [ "an", "a" ])
? o1.Content()
#--> ban split
composed from the signature, run for this page
QCSXTZZZIBWU
WalkForwardW
Walk forward collecting where the W condition holds (mirror of WalkBackwardW).
composed example
o1 = new stzString("banana split")
? @@( o1.WalkForwardW("@char = 'a'", 2) )
#--> [ 2, 4, 6 ]
composed from the signature, run for this page
no extension
FindWords
The position of each word of the string.
composed example
o1 = new stzString("banana split")
? @@( o1.FindWords() )
#--> [ 1, 8 ]
composed from the signature, run for this page
no extension
HasThisTrailingChar
Same as HasThisTrailingCharCS: HasThisTrailingChar(pcChar, pCS): TRUE iff content ends with a run of pcChar. (Distinct from HasTrailingChars() which is the 0-arg "has any trailing run" predicate above.)
composed example
o1 = new stzString("banana split")
? o1.HasThisTrailingChar("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
HasThisLeadingChar
Same as HasThisLeadingCharCS: TRUE if the string starts with the given char.
composed example
o1 = new stzString("banana split")
? o1.HasThisLeadingChar("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
FindTrailingChars
The positions of the trailing char run.
composed example
o1 = new stzString("banana split")
? @@( o1.FindTrailingChars() )
#--> [ 12 ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindLeadingChars
The positions of the leading char run.
composed example
o1 = new stzString("banana split")
? @@( o1.FindLeadingChars() )
#--> [ 1 ]
composed from the signature, run for this page
QCSXTZZZIBWU
TRUE if the last char equals the given one. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.TrailingCharIs("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
LeadingCharIs
TRUE if the first char equals the given one.
composed example
o1 = new stzString("banana split")
? o1.LeadingCharIs("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
PositionOfCentralChar: position of the center char (0 if even). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.PositionOfCentralChar()
#--> 0
composed from the signature, run for this page
no extension
IsNTimesMultipleOf(n, pcUnit): TRUE iff content is pcUnit repeated exactly n times. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsNTimesMultipleOf(2, "an")
#--> 0
composed from the signature, run for this page
no extension
MarkSubStringsCS
MarkSubStringsCS(pcSubStr, pCaseSensitive): mark every occurrence of pcSubStr with [|...|] (single-substring form).no extension
ReplaceMarquers
ReplaceMarquers(paReplacements): replace #1, #2, ... in order with paReplacements[1], [2], ... (engine-replace).no extension
ReplaceMarkers
Same as ReplaceMarquers: ReplaceMarquers(paReplacements): replace #1, #2, ... in order with paReplacements[1], [2], ... (engine-replace).no extension
FindInSections
the given sections (codepoint absolute positions).no extension
HasTrailingSubString
HasTrailingSubString(): TRUE iff content has any trailing word.
composed example
o1 = new stzString("banana split")
? o1.HasTrailingSubString()
#--> 0
composed from the signature, run for this page
no extension
HasLeadingSubString
TRUE if the string has a leading repeated-char run.
composed example
o1 = new stzString("banana split")
? o1.HasLeadingSubString()
#--> 0
composed from the signature, run for this page
no extension
HasTrailingSubStringOf
Same as EndsWithCS: Whether the string ends with the given suffix. (with the case-sensitivity dial)
composed example
o1 = new stzString("banana split")
? o1.HasTrailingSubStringOf("an")
#--> 0
composed from the signature, run for this page
no extension
HasLeadingSubStringOf
Same as StartsWithCS: Whether the string starts with the given prefix. (with the case-sensitivity dial)
composed example
o1 = new stzString("banana split")
? o1.HasLeadingSubStringOf("an")
#--> 0
composed from the signature, run for this page
no extension
TrailingSubStringZZOf
The [start, end] section of the trailing run of pcSub.no extension
MarquersPositions
Object wrappers around stzStringFunc global helpers so they resolve inside StzStringQ(){...} blocks. Inline rather than delegate to avoid same-name recursion.also written: FindMarkers · FindMarquers · MarkersPositionsno extension
Marker family: a "marquer" is a `#N` placeholder in content. These wrappers expose Find/First/Nth/Previous variants used by the StzStringQ block tests (609-628). Marquer accessors: the plain forms return the "#N" STRING, the Find* twins the position. 1 examples runalso written: FirstMarkerno extension
The position of the first marquer. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.FindFirstMarquer()
#--> 0
composed from the signature, run for this page
no extension
The nth marquer of the string. 1 examples runalso written: NthMarker
o1 = new stzString("My name is #1, my age is #2, and my job is #3. Again: my name is #1!")
# the marquer
? o1.NthMarquer(2)
# its position
? o1.FindNthMarquer(2)
#--> #2
#--> 26
library testno extension
The position of the nth marquer. 1 examples run
o1 = new stzString("My name is #1, my age is #2, and my job is #3. Again: my name is #1!")
# the marquer
? o1.NthMarquer(2)
# its position
? o1.FindNthMarquer(2)
#--> #2
#--> 26
library testno extension
The last marquer of the string. 1 examples runno extension
The position of the last marquer. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.FindLastMarquer()
#--> 0
composed from the signature, run for this page
no extension
The nth marquer after the given position. 1 examples run
o1 = new stzString("My name is #1, my age is #2, and my job is #3. Again: my name is #1!")
# the marquer
? o1.NextNthMarquerST(2, :StartingAt = 14)
# its position
? o1.FindNextNthMarquerST(2, :StartingAt = 14)
#--> #3
#--> 44
library testno extension
PreviousMarquers
The marquers before the given position.no extension
NextMarquers
The marquers after the given position.no extension
PreviousNthMarquer
The nth marquer before the given position.QCSXTZZZIBWU
FindNthPreviousMarquer
The nth occurrence of the substring from the given start position: the position(s).also written: FindPreviousNthMarker · FindPreviousNthMarquer
composed example
o1 = new stzString("banana split")
? o1.FindNthPreviousMarquer(2, 2)
#--> 0
composed from the signature, run for this page
no extension
FindMarquersAsSections
The [start, end] section of every marquer.also written: FindMarkersAsSectionsno extension
UniqueMarquersAndTheirPositions
Same as MarquersUZ: The unique marquers, each with ALL its positions.no extension
UniqueMarquersAndTheirSections
Same as MarquersUZZ: The unique marquers, each with ALL its [start, end] sections.no extension
MarquersSortedZ
MarquersSortedZ/ZZ: the ASCENDING-sorted marquers zipped onto the text-order positions / sections.also written: MarkersSortedZQCSXTZZZIBWU
MarquerByPosition
The marquer covering the given position.also written: MarkerByPositionno extension
PreviousMarquerZ
PreviousMarquerZ: the nearest previous marquer with its position.also written: PreviousMarkerZno extension
MarquersSortedUZ
MarquersSortedUZ: the unique marquers sorted by NUMBER, each with its own positions.also written: MarkersSortedUZQCSXTZZZIBWU
MarquerByPositions
The marquer at each of the given positions.also written: MarkerByPositions · MarkersByPositions · MarquersByPositionsno extension
PreviousNthMarquerAndItsPosition
Same as PreviousNthMarquerZ: PreviousNthMarquerZ: the marquer with its position.no extension
TRUE if the given substring is bounded by the given bound(s). 1 examples run
# the named-param shape is recognised
? Q(:IsBoundedBy = ".").IsIsBoundedByNamedParam()
# the direct check
? Q(".♥.").SubStringIsBoundedBy("♥", ".")
# the SubStringXT spelling
? Q(".♥.").SubStringXT("♥", :IsBoundedBy = ".")
#--> 1
#--> 1
#--> 1
library testno extension
ToListInShortForm(): render the hosted list in the short range syntax -- "1 : 3" for numbers, '"A" : "D"' for strings. 1 examples runalso written: ToListInStringSF
composed example
o1 = new stzString("banana split")
? o1.ToListInShortForm()
#--> "b" : "t"
composed from the signature, run for this page
no extension
FindNextOccurrence
The position of the next occurrence of pcSub after the given position (0 when there is none).
composed example
o1 = new stzString("banana split")
? o1.FindNextOccurrence("an", 2)
#--> 4
composed from the signature, run for this page
no extension
UnicodesPerChar
The codepoint of each char, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.UnicodesPerChar() )
#--> [ [ "b", 98 ], [ "a", 97 ], [ "n", 110 ], [ "a", 97 ], [ "n", 110 ], [ "a", 97 ], [ " ", 32 ], [ "s", 115 ], [ "p", 112 ], [ "l", 108 ], [ "i", 105 ], [ "t", 116 ] ]
composed from the signature, run for this page
no extension
UnicodeOfChar
The codepoint of the given char.
composed example
o1 = new stzString("banana split")
? o1.UnicodeOfChar("a")
#--> 97
composed from the signature, run for this page
no extension
Turn the content into its hex digest with the given algorithm (mutating, engine-backed). 1 examples runalso named: digest checksum sha md5 fingerprint
o1 = new stzString("original text before hashing")
o1.Hash(:MD5)
# the md5 hex digest
? o1.Content()
#--> 8ffad81de2e13a7b68c7858e4d60e263
library testQCSXTZZZIBWU
Hashed
The hex digest of the content with the given algorithm, as data.no extension
EachCharBoxedRounded
Each char in its own rounded box cell.also written: EachCharBoxRounded · EachCharBoxedRoundedDashed
composed example
o1 = new stzString("banana split")
? o1.EachCharBoxedRounded()
#--> ╭───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───╮
#--> │ b │ a │ n │ a │ n │ a │   │ s │ p │ l │ i │ t │
#--> ╰───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───╯
composed from the signature, run for this page
QCSXTZZZIBWU
TitlecasedInLocale
The string titlecased for the given locale (falls back to plain titlecase).
composed example
o1 = new stzString("banana split")
? o1.TitlecasedInLocale("an")
#--> Banana Split
composed from the signature, run for this page
no extension
CapitalisedInLocale
Same as Titlecased: The string in Title Case (each word capitalized).
composed example
o1 = new stzString("banana split")
? o1.CapitalisedInLocale("an")
#--> Banana Split
composed from the signature, run for this page
no extension
CapitalizedInLocale
Same as Titlecased: The string in Title Case (each word capitalized).
composed example
o1 = new stzString("banana split")
? o1.CapitalizedInLocale("an")
#--> Banana Split
composed from the signature, run for this page
no extension
FindPreviousOccurrence
The position of the nearest occurrence of pcSub before the given position (0 when there is none).
composed example
o1 = new stzString("banana split")
? o1.FindPreviousOccurrence("an", 2)
#--> 0
composed from the signature, run for this page
no extension
ToListInNormalForm(): the hosted list rendered in normal bracketed form (whatever syntax hosted it -- short ranges included). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ToListInNormalForm()
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]
composed from the signature, run for this page
no extension
NumberOfLeadingItems
How long the leading char run is.
composed example
o1 = new stzString("banana split")
? o1.NumberOfLeadingItems()
#--> 1
composed from the signature, run for this page
no extension
NumberOfTrailingItems
How long the trailing char run is.
composed example
o1 = new stzString("banana split")
? o1.NumberOfTrailingItems()
#--> 1
composed from the signature, run for this page
no extension
RemoveRightOccurrence
Remove the LAST occurrence of pcSub (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveRightOccurrence("an")
? o1.Content()
#--> bana split
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsHybridOrientation
TRUE if the content mixes LTR (Latin) and RTL (Arabic-side) scripts.
composed example
o1 = new stzString("banana split")
? o1.ContainsHybridOrientation()
#--> 0
composed from the signature, run for this page
no extension
Which abbreviation form the language string carries (:Short / :Long). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.LanguageAbbreviationForm()
#--> unknown
composed from the signature, run for this page
no extension
RepresentsSignedRealNumber
TRUE if the string is a SIGNED real-number literal.
composed example
o1 = new stzString("banana split")
? o1.RepresentsSignedRealNumber()
#--> 0
composed from the signature, run for this page
no extension
RepresentsUnsignedRealNumber
TRUE if the string is an UNSIGNED real-number literal.
composed example
o1 = new stzString("banana split")
? o1.RepresentsUnsignedRealNumber()
#--> 0
composed from the signature, run for this page
no extension
TRUE if the string is a 3-letter (long) language abbreviation (ISO 639-2/3). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsLongLanguageAbbreviation()
#--> 0
composed from the signature, run for this page
no extension
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests. 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveLeadingAndTrailingChars()
? o1.Content()
#--> anana spli
composed from the signature, run for this page
QCSXTZZZIBWU
SubStringComesBetween is order-INDEPENDENT (matches the original): TRUE if pcSub sits between the two bounds in EITHER order. 1 examples run
o1 = new stzString("---♥♥...**---")
# '...' comes between ♥♥ and ** (in order)
? o1.SubStringComesBetween("...", "♥♥", "**")
# and order-independently between ** and ♥♥
? o1.SubStringComesBetween("...", "**", "♥♥")
#--> 1
#--> 1
library testno extension
TRUE if pcSub occurs BEFORE pcOther (a substring, or :Position = n). 1 examples runalso written: SubStringComesBeforeSubString
composed example
o1 = new stzString("banana split")
? o1.SubStringComesBefore("an", "an")
#--> 0
composed from the signature, run for this page
no extension
TRUE if pcSub occurs AFTER pcOther (a substring, or :Position = n). 1 examples runalso written: SubStringComesAfterSubString
composed example
o1 = new stzString("banana split")
? o1.SubStringComesAfter("an", "an")
#--> 0
composed from the signature, run for this page
no extension
TRUE if pcSub occurs before the given position. 1 examples runalso written: SubStringComesBeforePosition
composed example
o1 = new stzString("banana split")
? o1.SubStringComesBeforePos("an", 2)
#--> 0
composed from the signature, run for this page
no extension
TRUE if pcSub occurs after the given position. 1 examples runalso written: SubStringComesAfterPosition
composed example
o1 = new stzString("banana split")
? o1.SubStringComesAfterPos("an", 2)
#--> 0
composed from the signature, run for this page
no extension
TRUE if pcSub occurs between the two given positions. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.SubStringComesBetweenPositions("an", 2, 5)
#--> 1
composed from the signature, run for this page
no extension
InQ
Narrative-sub accessor used by SubStringQ(["sub", :In = "host"]). Stored as the LAST line of the wrapped content separated by char(1), so we don't need a class-level attribute that Haro would require declaring with the other @aContent slots. InQ(host): the host becomes the new content; the prior content is kept as the narrative sub.no extension
SubStringQ
Open a NARRATIVE chain about the given substring (ComesBefore / ComesAfter...).no extension
@
@(pcSub): narrative-set the subject substring; returns self.no extension
@RemoveItQ
@RemoveItQ(): remove every occurrence of the narrative sub.no extension
AndThenQ
Narrative glue: returns the object unchanged, chainable.no extension
AndQ
Narrative glue: returns the object unchanged, chainable.no extension
SpacifyItQ
Spacify the content (chars separated by spaces), chainable.no extension
SpacifyItR
The R-suffixed form returns the RESULT string (not the object).
composed example
o1 = new stzString("banana split")
? o1.SpacifyItR()
#--> b a n a n a   s p l i t
composed from the signature, run for this page
no extension
@0
Narrative closer: the content, as data (positional form).no extension
ComesBeforeSubString
Narrative form: TRUE if the chain's substring comes before the given one.
composed example
o1 = new stzString("banana split")
? o1.ComesBeforeSubString("an")
#--> 0
composed from the signature, run for this page
no extension
ComesAfterSubString
Narrative form: TRUE if the chain's substring comes after the given one.
composed example
o1 = new stzString("banana split")
? o1.ComesAfterSubString("an")
#--> 0
composed from the signature, run for this page
no extension
ComesBetweenPositions
Narrative form: TRUE if the chain's substring lies between the two positions.
composed example
o1 = new stzString("banana split")
? o1.ComesBetweenPositions(2, 5)
#--> 0
composed from the signature, run for this page
no extension
ComesBeforePosition
Narrative form: TRUE if the chain's substring comes before the position.
composed example
o1 = new stzString("banana split")
? o1.ComesBeforePosition(2)
#--> 0
composed from the signature, run for this page
no extension
ComesAfterPosition
Narrative form: TRUE if the chain's substring comes after the position.
composed example
o1 = new stzString("banana split")
? o1.ComesAfterPosition(2)
#--> 0
composed from the signature, run for this page
no extension
SubStringComesBetweenSubStrings
TRUE if pcSub occurs between the two given substrings.no extension
CharsAndTheirUnicodes
Each char paired with its codepoint (char first).
composed example
o1 = new stzString("banana split")
? @@( o1.CharsAndTheirUnicodes() )
#--> [ [ "b", 98 ], [ "a", 97 ], [ "n", 110 ], [ "a", 97 ], [ "n", 110 ], [ "a", 97 ], [ " ", 32 ], [ "s", 115 ], [ "p", 112 ], [ "l", 108 ], [ "i", 105 ], [ "t", 116 ] ]
composed from the signature, run for this page
no extension
ToListInStringNF
The content as a list literal in normal form, as a string.
composed example
o1 = new stzString("banana split")
? o1.ToListInStringNF()
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]
composed from the signature, run for this page
no extension
SectionBounds
SectionBounds(n1, n2, nLeftMax, nRightMax): the [open, close] bound substrings just before n1 and just after n2.
composed example
o1 = new stzString("banana split")
? @@( o1.SectionBounds(2, 5, 2, 2) )
#--> [ "b", "a " ]
composed from the signature, run for this page
QCSXTZZZIBWU
FirstNonSpaceChar
The first non-space char of the string.
composed example
o1 = new stzString("banana split")
? o1.FirstNonSpaceChar()
#--> b
composed from the signature, run for this page
no extension
LastNonSpaceChar
The last non-space char of the string.
composed example
o1 = new stzString("banana split")
? o1.LastNonSpaceChar()
#--> t
composed from the signature, run for this page
no extension
FirstNonSpaceCharPosition
The position of the first non-space char.also written: FindFirstNonSpaceChar
composed example
o1 = new stzString("banana split")
? o1.FirstNonSpaceCharPosition()
#--> 1
composed from the signature, run for this page
no extension
LastNonSpaceCharPosition
The position of the last non-space char.also written: FindLastNonSpaceChar
composed example
o1 = new stzString("banana split")
? o1.LastNonSpaceCharPosition()
#--> 12
composed from the signature, run for this page
no extension
StringsW
Treat the content as a list of strings and filter by the W condition.no extension
Multiply EVERY number inside the string by n (mutating). 2 examples runalso written: MultipliedByNQCSXTZZZIBWU
Divide every number inside the string by n (mutating). 2 examples runQCSXTZZZIBWU
Add n to every number inside the string (mutating). 2 examples runQCSXTZZZIBWU
Subtract n from every number inside the string (mutating). 2 examples runQCSXTZZZIBWU
SubtractN
Subtract n from every number inside the string (mutating).QCSXTZZZIBWU
FromUrl
URL fetch (stub: no network in this version; answers empty).no extension
Insert(pcSub, :BeforePosition = n / :AfterPosition = n / n). 3 examples runalso named: put at position add at place into inject
composed example
o1 = new stzString("banana split")
o1.Insert("an", 2)
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
WalkUntil
Walk the chars forward: the position where the condition first holds.
composed example
o1 = new stzString("banana split")
? o1.WalkUntil("@char = 'a'")
#--> 1
composed from the signature, run for this page
no extension
EachCharBoxedDashed
Each char in its own dashed box cell.
composed example
o1 = new stzString("banana split")
? o1.EachCharBoxedDashed()
#--> ┌╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┐
#--> ┊ b ┊ a ┊ n ┊ a ┊ n ┊ a ┊   ┊ s ┊ p ┊ l ┊ i ┊ t ┊
#--> └╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┘
composed from the signature, run for this page
no extension
The string as boxed char cells with the occurrences of pcSub visually marked (the VizFind map, boxed). 1 examples run
o1 = new stzString("..STZ..StZ..stz...STZ")
# bullets at 3, 8, 13 and 19
? o1.VizFindBoxedCSXT("STZ", :CS = FALSE, [ :Numbered = TRUE ])
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ . │ . │ S │ T │ Z │ . │ . │ S │ t │ Z │ . │ . │ s │ t │ z │ . │ . │ . │ S │ T │ Z │
#--> └───┴───┴─•─┴───┴───┴───┴───┴─•─┴───┴───┴───┴───┴─•─┴───┴───┴───┴───┴───┴─•─┴───┴───┘
library testQCSXTZZZIBWU
VizFindBoxedRounded
The boxed VizFind map with rounded corners.no extension
VizFindBoxedDashed
The boxed VizFind map with dashed lines.no extension
VizFindManyXT2
Same as VizFindManyXT: Accept VizFindManyXT with single sub string or list.no extension
IsADigitInString
TRUE if the string is a single digit.
composed example
o1 = new stzString("banana split")
? o1.IsADigitInString()
#--> 0
composed from the signature, run for this page
no extension
FindSSZ
Section-bounded find: the positions of pcSub within n1..n2.
composed example
o1 = new stzString("banana split")
? @@( o1.FindSSZ("an", 2, 5) )
#--> [ 2, 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
Replace the substring at each given position with its counterpart in the new list (mutating). 1 examples run
o1 = new stzString("--[...]---[...]---[...]---[~~~]--[~~~]--")
o1.ReplaceSubStringAtPositionsByMany([ 27, 34 ], "[~~~]", [ "bbb", "aaa" ])
# each got its own name
? o1.Content()
#--> --[...]---[...]---[...]---bbb--aaa--
library testno extension
ToListInString(): the hosted list rendered in normal form (@@). 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ToListInString()
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]
composed from the signature, run for this page
no extension
LanguageAbbreviationFor
The ISO 639-1 code for the given language name.no extension
LongLanguageAbbreviationFor
The 3-letter ISO 639-2/3 code for the given language name.no extension
SplitAroundSections
Split the string around the given sections (the sections excluded).
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAroundSections([ "an", "a" ]) )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitAroundSubStrings
Split around the occurrences of EACH given substring.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAroundSubStrings([ "an", "a" ]) )
#--> [ "b", " split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitAroundSection
Split the string around one [start, end] section.QCSXTZZZIBWU
MarquersPositionsSortedInAscending
The marquer positions in ascending order.also written: MarkersPositionsSortedInAscendingno extension
MarquersPositionsSortedInDescending
The marquer positions in descending order.also written: MarkersPositionsSortedInDescendingno extension
The position of the nth occurrence after the given position (:Of = substring form). 1 examples run
o1 = new stzString("12500;NAME;10;0")
# the next one from 1
? o1.NextOccurrence( :Of = ";", :StartingAt = 1 )
# the 2nd from 5
? o1.NextNthOccurrence( 2, :Of = ";", :StartingAt = 5)
#--> 6
#--> 11
library testno extension
An ascending-sorted copy of the chars; the original is unchanged. 2 examples run
o1 = new stzString("73964532041")
# ascending
? o1.SortedInAscending()
# descending
? o1.SortedInDescending()
#--> 01233445679
#--> 97654433210
library testno extension
A descending-sorted copy of the chars; the original is unchanged. 2 examples run
o1 = new stzString("73964532041")
# ascending
? o1.SortedInAscending()
# descending
? o1.SortedInDescending()
#--> 01233445679
#--> 97654433210
library testno extension
TRUE if the chars are sorted, ascending OR descending. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsSorted()
#--> 0
composed from the signature, run for this page
no extension
The sorting order of the chars (:Ascending, :Descending, ...). 2 examples run
composed example
o1 = new stzString("banana split")
? o1.SortingOrder()
#--> unsorted
composed from the signature, run for this page
no extension
Sort the CHARS of the string in ascending order in place (mutating). For a copy, use Sorted. 1 examples run
composed example
o1 = new stzString("banana split")
o1.Sort()
? o1.Content()
#--> aaabilnnpst
composed from the signature, run for this page
QCSXTZZZIBWU
SortInAscending
Sort the chars in ascending order in place (mutating).
composed example
o1 = new stzString("banana split")
o1.SortInAscending()
? o1.Content()
#--> aaabilnnpst
composed from the signature, run for this page
QCSXTZZZIBWU
SortInDescending
Sort the chars of the string in descending order in place (mutating).
composed example
o1 = new stzString("banana split")
o1.SortInDescending()
? o1.Content()
#--> tspnnlibaaa
composed from the signature, run for this page
QCSXTZZZIBWU
LeadingSubStringRemove
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.no extension
RemoveLeadingSubString
Same as LeadingSubStringRemove: Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.
composed example
o1 = new stzString("banana split")
o1.RemoveLeadingSubString()
? o1.Content()
#--> anana split
composed from the signature, run for this page
no extension
A copy with the leading char run removed. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.LeadingCharsRemoved()
#--> anana split
composed from the signature, run for this page
no extension
TrailingCharsRemoved
A copy with the trailing char run removed.
composed example
o1 = new stzString("banana split")
? o1.TrailingCharsRemoved()
#--> banana spli
composed from the signature, run for this page
no extension
Remove the first n chars (mutating). 1 examples run
o1 = new stzString("123BATISTA")
o1.RemoveNFirstChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("123BATISTA").FirstNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
library testQCSXTZZZIBWU
Remove the last n chars (mutating). 1 examples run
o1 = new stzString("BATISTA123")
o1.RemoveNLastChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA123").LastNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
library testQCSXTZZZIBWU
BeginsWith(pcSub): TRUE iff content starts with pcSub. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.BeginsWith("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
The position of the nth occurrence of pcSub after the given position. 2 examples run
composed example
o1 = new stzString("banana split")
? o1.FindNextNthOccurrence(2, "an", 5)
#--> 0
composed from the signature, run for this page
no extension
The position of the nth occurrence before the given position. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.NthPreviousOccurrence(2, "an", 5)
#--> 2
composed from the signature, run for this page
no extension
FindPreviousNthOccurrence(n, :Of = sub, :StartingAt = pos): position of -- the n-th occurrence of sub BEFORE pos (0 if none). FindFirstPrevious / -- FindFirstNext are the n=1 shorthands. The nth occurrence of the substring from the given start position: the position(s). 1 examples runalso written: FindPreviousNthOccurrenceOf
composed example
o1 = new stzString("banana split")
? o1.FindPreviousNthOccurrence(2, "an", 2)
#--> 0
composed from the signature, run for this page
no extension
The first occurrence of the substring from the given start position: the position(s). 1 examples runalso written: FindFirstPreviousOccurrence
composed example
o1 = new stzString("banana split")
? o1.FindFirstPrevious("an", 2)
#--> 0
composed from the signature, run for this page
no extension
The first occurrence of the substring from the given start position: the position(s). 1 examples runalso written: FindFirstNextOccurrence
composed example
o1 = new stzString("banana split")
? o1.FindFirstNext("an", 2)
#--> 2
composed from the signature, run for this page
no extension
The distance in chars from the given position to the target. 2 examples run
o1 = new stzString("---456---")
# the exclusive gap
? o1.DistanceTo("6", :StartingAt = 4)
# the inclusive XT distance
? o1.DistanceToXT("6", :StartingAt = 4)
#--> 1
#--> 3
library testQCSXTZZZIBWUST
ContainsTheLetters(pacLetters): TRUE iff content contains every letter in pacLetters (in any order). 1 examples run
o1 = new stzString("Adoption of the plan B")
# contains the letters N and b
? o1.ContainsTheLetters([ "N", "b" ])
#--> 1
library testno extension
FindSubStringBetween
FindSubStringBetween(pcSub, pcOpen, pcClose): positions of pcSub inside any pcOpen..pcClose section.no extension
ToStzText
ToStzText() -- bridge into the text-meaning domain (base/natural/stzText).no extension
PartsUsing
The parts of the string partitioned by the given expression's value.
composed example
o1 = new stzString("banana split")
? @@( o1.PartsUsing("@char = 'a'") )
#--> [ "b", "a", "n", "a", "n", "a", " split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsNoOneOfThese(paSubStr): TRUE iff content contains NONE of the listed substrings. 1 examples runalso written: ContainsNoneOfThese
o1 = new stzString("abcdef")
# none present
? o1.ContainsNoOneOfThese([ "xy", "xyz", "mwb" ])
# de spoils it
? o1.ContainsNoOneOfThese([ "xy", "xyz", "de", "mwb" ])
#--> 1
#--> 0
library testno extension
IsLowercased / IsUppercased: predicates over content's case form. 1 examples run
# tunis is lowercased
? StzStringQ("tunis").IsLowercased()
# TUNIS is uppercased
? StzStringQ("TUNIS").IsUppercased()
# Tunis is titlecased
? StzStringQ("Tunis").IsTitlecased()
#--> 1
#--> 1
#--> 1
library testno extension
TRUE if the string is in UPPER CASE. 1 examples run
# tunis is lowercased
? StzStringQ("tunis").IsLowercased()
# TUNIS is uppercased
? StzStringQ("TUNIS").IsUppercased()
# Tunis is titlecased
? StzStringQ("Tunis").IsTitlecased()
#--> 1
#--> 1
#--> 1
library testno extension
(IsLowercase / IsUppercase already exist earlier.) HasThisCentralChar(pcChar): TRUE iff the central char is pcChar. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.HasThisCentralChar("an")
#--> 0
composed from the signature, run for this page
no extension
A copy with the last n chars removed. 1 examples runalso written: NLastCharsRemoved
o1 = new stzString("BATISTA123")
o1.RemoveNLastChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA123").LastNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
library testno extension
A copy with the first n chars removed. 1 examples runalso written: NFirstCharsRemoved
o1 = new stzString("123BATISTA")
o1.RemoveNFirstChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("123BATISTA").FirstNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
library testno extension
IsTitleCased: every space-separated word starts with an uppercase letter; the rest of that word is lower. 1 examples run
# tunis is lowercased
? StzStringQ("tunis").IsLowercased()
# TUNIS is uppercased
? StzStringQ("TUNIS").IsUppercased()
# Tunis is titlecased
? StzStringQ("Tunis").IsTitlecased()
#--> 1
#--> 1
#--> 1
library testno extension
ContainsLetters(): TRUE iff the content contains any letter. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsLetters()
#--> 1
composed from the signature, run for this page
no extension
The chars in reverse order, as data; the original is unchanged. 2 examples runalso named: backwards text mirrored reversed stringalso written: Inversed
# SOFTANZA backwards
? StzStringQ("SOFTANZA").CharsReversed()
# whitespace squeezed
? StzStringQ(" Softanza    Near-natural Programming   ").Simplified()
#--> AZNATFOS
#--> Softanza Near-natural Programming
library testno extension
IsAlmostAFunctionCall(): TRUE iff content roughly matches `identifier(...)` syntax. 1 examples run
# a bare call
? StzStringQ('myfunc()').IsAlmostAFunctionCall()
# a call with args
? StzStringQ('my_func("name")').IsAlmostAFunctionCall()
#--> 1
#--> 1
library testno extension
WalkBackwardW
WalkBackwardW(pcCondition | :StartingAt = N, :UntilBefore = expr): walk content backwards from a starting position; returns the first position where the :UntilBefore predicate is TRUE (named-param form), or all positions where pcCondition is TRUE (string form).
composed example
o1 = new stzString("banana split")
? @@( o1.WalkBackwardW("@char = 'a'", 2) )
#--> [ 6, 4, 2 ]
composed from the signature, run for this page
no extension
ReplaceNthCharQ alias. Replace the char at position n with the given one (chainable). 1 examples run
# positional
? StzStringQ("évènement").ReplaceNthCharQ(3, "*").Content()
# named
? StzStringQ("évènement").ReplaceNthCharQ(3, :With = "*").Content()
#--> év*nement
#--> év*nement
library testno extension
CharQ
The char at position n, wrapped as a stzChar object.no extension
PartsClassifiedUsing
Same as PartsClassifiedUsingXT: The parts grouped by their partitioner value: [ [value, [parts...]], ... ].
composed example
o1 = new stzString("banana split")
? @@( o1.PartsClassifiedUsing("@char = 'a'") )
#--> [ [ 0, [ "b", "n", "n", " split" ] ], [ 1, [ "a", "a", "a" ] ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
PartsAndPartitionersUsingXT
Each part zipped with its partitioner value (the expression's result for it).also written: Parts2Using
composed example
o1 = new stzString("banana split")
? @@( o1.PartsAndPartitionersUsingXT("@char = 'a'") )
#--> [ [ "b", 0 ], [ "a", 1 ], [ "n", 0 ], [ "a", 1 ], [ "n", 0 ], [ "a", 1 ], [ " split", 0 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceAllChars(pcOld, pcNew): char-by-char map. ReplaceAllChars: (:With = pcNew) : replace every char with pcNew Two-arg (pcOld, pcNew) form lives in ReplaceAllCharsXT. 1 examples run
o1 = new stzString("Use these two letters: س and ص.")
o1.ReplaceAllChars( :With = "*" )
# as many stars as chars
? o1.Content()
#--> *******************************
library testQCSXTZZZIBWU
How many chars satisfy the W condition. 1 examples run
# counting the lowercase "a" gives 3
? Q("SoftAnza Libraray").CountCharsW('@char = "a"')
# counting "a" case-insensitively (a or A) gives 4
? Q("SoftAnza Libraray").CountCharsW('(@char = "a") or (@char = "A")')
#--> 3
#--> 4
library testno extension
NthSubStringAfterSplittingStringUsing(n, pcSep): the n-th piece after splitting on pcSep. 1 examples run
o1 = new stzString("abc;123;gafsa;ykj")
# via SplitQ
? o1.SplitQ(";").NthItem(3)
# via the long natural name
? o1.NthSubstringAfterSplittingStringUsing(3, ";")
#--> gafsa
#--> gafsa
library testno extension
Same as ContainsEachCS: ContainsEachCS(pacSubStr, pCaseSensitive): TRUE iff content contains every listed substring. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsEach([ "an", "a" ])
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsEachOfThese
Same as ContainsEachCS: ContainsEachCS(pacSubStr, pCaseSensitive): TRUE iff content contains every listed substring.
composed example
o1 = new stzString("banana split")
? o1.ContainsEachOfThese([ "an", "a" ])
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
MultiplyBy(n): repeat content n times. MultiplyBy(list): distribute -- "a" x ["b","c"] -> "ab" + "ac". 1 examples run
o1 = new stzString("a")
o1.MultiplyBy([ "b", "c", "d" ])
# ab + ac + ad
? o1.Content()
#--> abacad
library testQCSXTZZZIBWU
ReplaceFirstNChars
ReplaceFirstNChars(n, pcNew): replace the first n chars with pcNew.
composed example
o1 = new stzString("banana split")
o1.ReplaceFirstNChars(2, "AN")
? o1.Content()
#--> ANnana split
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceLastNChars
Replace the last n chars with the given string (mutating).
composed example
o1 = new stzString("banana split")
o1.ReplaceLastNChars(2, "AN")
? o1.Content()
#--> banana splAN
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceNthOccurrence
Replace only the nth occurrence of pcSub with pcNew (mutating).
composed example
o1 = new stzString("banana split")
o1.ReplaceNthOccurrence(2, "an", "AN")
? o1.Content()
#--> banANa split
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveFirstOccurrence(pcSub) -- accepts :Of = pcSub. 1 examples run
o1 = new stzString("LandRingoriaLand")
o1.RemoveFirstOccurrence( :Of = "Land")
# the trailing one stays
? o1.Content()
#--> RingoriaLand
library testQCSXTZZZIBWU
Orientation
Orientation(): :LTR for normal scripts, :RTL when first char is Arabic/Hebrew/etc.
composed example
o1 = new stzString("banana split")
? o1.Orientation()
#--> ltr
composed from the signature, run for this page
no extension
RemoveNLeftChars / RemoveNRightChars aliases. 2 examples run
o1 = new stzString("سلام لأهل مصر الكرام")
o1.RemoveNLeftChars(7)
# the head is gone, string-order
? o1.Content()
#--> هل مصر الكرام
library testQCSXTZZZIBWU
Same as RemoveNLastChars: Remove the last n chars (mutating). 1 examples run
o1 = new stzString("eeebxeTuniseee")
o1.RemoveNLeftChars(3)
o1.RemoveNRightChars(3)
# the middle remains
? o1.Content()
#--> bxeTunis
library testQCSXTZZZIBWU
Replace the occurrences of pcSub cycling through the given replacements (same as ReplaceByMany). 1 examples run
o1 = new stzString("--Ring--Softanza--")
o1.ReplaceWithMany("--", [ "1", "2", "3" ])
# the three '--' get 1, 2, 3
? o1.Content()
#--> 1Ring2Softanza3
library testQCSXTZZZIBWU
Replace each substring with its same-index counterpart (pairwise, mutating). 1 examples run
o1 = new stzString("--Ring__Softanza..")
o1.ReplaceManyWithMany([ "--", "__", ".." ], [ "1", "2", "3" ])
# -- / __ / .. become 1 / 2 / 3
? o1.Content()
#--> 1Ring2Softanza3
library testQCSXTZZZIBWU
AlignedXT(:Width = n, :PadChar = " ", :Direction = :Left/:Right/:Center) 1 examples run
# eleven dots each side
? Q("SFOTANZA").AlignedXT( :Width = 30, :Char = ".", :Direction = :Center )
#--> ...........SFOTANZA...........
library testno extension
CompressUsingBinary(pcMask): keep the chars whose mask bit is "1", drop the "0" ones ("ABCDEFGH" x "10011011" -> "ADEGH"). 1 examples run
o1 = new stzString("ABCDEFGH")
o1.CompressUsingBinary("10011011")
# the 1-bits survive
? o1.Content()
#--> ADEGH
library testQCSXTZZZIBWU
Same as UnicodeCompareWithCS: UnicodeCompareWithCS(pcOther, pCaseSensitive): codepoint comparison. Returns :Less, :Equal or :Greater. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.UnicodeCompareWith("an")
#--> greater
composed from the signature, run for this page
QCSXTZZZIBWU
Locale-flavored Unicode comparison with the given string. 1 examples run
# RESERVE beats reserve on the tie-break
? Q("RÉSERVÉ").UnicodeCompareWithInSystemLocale("réservé")
#--> greater
library testno extension
ContainsLetter(pcLetter): TRUE iff content contains pcLetter. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.ContainsLetter("an")
#--> 1
composed from the signature, run for this page
no extension
ContainsBoth(pcA, pcB): TRUE iff content contains BOTH. 1 examples run
o1 = new stzString("ar_TN-tun")
# contains each of _ and -
? o1.ContainsEachCS([ "_", "-" ], TRUE)
# contains both
? o1.ContainsBoth("_", "-")
#--> 1
#--> 1
library testno extension
NumericValue
NumericValue(): content as a number.no extension
NumberValue
The numeric value of the content. ring_number() not 0+ : Haro's 0+str coercion returns 0 on the first use after ANY caught raise (VM quirk); ring_number() is immune.no extension
IsListInShortForm: rough check for `a:b` short-form list literal. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsListInShortForm()
#--> 0
composed from the signature, run for this page
no extension
IsALetterOf(pcOther): TRUE iff single-char This appears in pcOther. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsALetterOf("an")
#--> 0
composed from the signature, run for this page
no extension
RemoveLeftOccurrence
Same as RemoveFirstOccurrence: RemoveFirstOccurrence(pcSub) -- accepts :Of = pcSub.
composed example
o1 = new stzString("banana split")
o1.RemoveLeftOccurrence("an")
? o1.Content()
#--> bana split
composed from the signature, run for this page
QCSXTZZZIBWU
NumberForm(): :Integer, :Decimal, :Hex, :Binary, or :Other. 2 examples run
composed example
o1 = new stzString("banana split")
? o1.NumberForm()
#--> other
composed from the signature, run for this page
no extension
PositionAfter
PositionAfter(pcSub): position right after first occurrence.
composed example
o1 = new stzString("banana split")
? o1.PositionAfter("an")
#--> 4
composed from the signature, run for this page
no extension
PositionBefore
The position just BEFORE the first occurrence of pcSub.
composed example
o1 = new stzString("banana split")
? o1.PositionBefore("an")
#--> 1
composed from the signature, run for this page
no extension
InsertSubStrings(anPos, pacStr): insert pacStr[i] at anPos[i], processed from highest position down so earlier positions stay valid. 3 examples run
o1 = new stzString("All our software versions must be updated!")
o1.InsertSubStrings( o1.PositionAfter("versions"), [ "V1", "V2", "V3" ])
# parenthesized with padding spaces
? o1.Content()
#--> All our software versions (V1, V2, V3)  must be updated!
library testQCSXTZZZIBWU
ItemsWhere
Same as CharsW: (IsTitlecased -- Haro is case-insensitive, just one def.) CharsW(pcCondition): the characters where the predicate is TRUE (predicate-driven char filter).
composed example
o1 = new stzString("banana split")
? @@( o1.ItemsWhere("@char = 'a'") )
#--> [ "a", "a", "a" ]
composed from the signature, run for this page
no extension
IsShortLanguageAbbreviation(): 2-letter ISO 639-1-style alpha code. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.IsShortLanguageAbbreviation()
#--> 0
composed from the signature, run for this page
no extension
IsLatin(): TRUE iff every char is ASCII-Latin. 1 examples run
# Latin script
? StzStringQ("Ⅱ").IsLatin()
# and a Roman number
? StzCharQ("Ⅱ").IsRomanNumber()
#--> 1
#--> 1
library testno extension
ContainsNOccurrences
TRUE if pcSub occurs exactly n times.
composed example
o1 = new stzString("banana split")
? o1.ContainsNOccurrences(2, "an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
EXTRACT the digits as one string ("number 125" -> "125"). 1 examples runalso written: OnlyDigits
# digits only
? Q("number 12500 number 18200").OnlyNumbers()
#--> 1250018200
library testno extension
Pad the string to length n with spaces (mutating). 1 examples run
o1 = new stzString("ABC")
o1.ExtendTo(5)
# it is padded to width 5 with spaces
? o1.Content()
#--> ABC
library testQCSXTZZZIBWU
Remove pcSub only where it is bounded by the given bounds (mutating). 1 examples run
o1 = new stzString("__^^^__^^♥^^__")
o1.RemoveSubStringBoundedBy("♥", "^^")
# heart gone, carets stay
? o1.Content()
#--> __^^^__^^^^__
library testQCSXTZZZIBWU
Same as RemoveNFirstChars: Remove the first n chars (mutating). 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveNCharsLeft(2)
? o1.Content()
#--> nana split
composed from the signature, run for this page
QCSXTZZZIBWU
Same as RemoveNLastChars: Remove the last n chars (mutating). 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveNCharsRight(2)
? o1.Content()
#--> banana spl
composed from the signature, run for this page
QCSXTZZZIBWU
BoxEachChar
Box each char in its own cell, in place (mutating).QCSXTZZZIBWU
CharsBoxed
Each char in its own box cell, as data.
composed example
o1 = new stzString("banana split")
? o1.CharsBoxed()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ b │ a │ n │ a │ n │ a │   │ s │ p │ l │ i │ t │
#--> └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
composed from the signature, run for this page
no extension
Box each char in its own cell, in place (mutating). 2 examples run
o1 = new stzString("SOFTANZA")
o1.BoxifyChars()
# eight cells
? o1.Content()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ S │ O │ F │ T │ A │ N │ Z │ A │
#--> └───┴───┴───┴───┴───┴───┴───┴───┘
library testQCSXTZZZIBWU
FindAnyBoundedByAsSectionss
Same as FindAnyBoundedByAsSections, the pair given as two args.no extension
ReplaceOccurrences: (pcOld, pcNew) : every-occurrence replace (anN, :Of = pcOld, :By = pcNew | listOfReplacements) : selected n-th occurrences 1 examples run
o1 = new stzString("--[...]---[...]---[...]---[~~~]--[~~~]--")
o1.ReplaceOccurrences([ 2, :and = 3 ], :of = "[...]", :by = [ "ONE", :and = "TWO" ])
# first block untouched
? o1.Content()
#--> --[...]---ONE---TWO---[~~~]--[~~~]--
library testQCSXTZZZIBWU
FindConsecutiveSubStringsOfNChars
FindConsecutiveSubStringsOfNChars(n): the unique phase offsets that carry at least one full window (the original returns U(XT) over the per-window phase labels).
composed example
o1 = new stzString("banana split")
? @@( o1.FindConsecutiveSubStringsOfNChars(2) )
#--> [ 1, 2 ]
composed from the signature, run for this page
QCSXTZZZIBWU
StringCase(): return :Lowercase, :Uppercase, :TitleCase, or :Mixed. 2 examples run
# its script reads latin
? TQ("ı").Script()
# it is lowercase
? Q("ı").StringCase()
# its dotted capital is uppercase
? Q("İ").StringCase()
#--> latin
#--> lowercase
#--> uppercase
library testno extension
FindBoundedBy
Same as FindBoundedByCS: FindBoundedBy / FindBoundedByCS -- the most common spelling in narrative tests. Returns the [startPos, endPos] of each bounded section. FindBoundedBy: the content START positions of the bounded regions (the ZZ / AsSections forms carry the spans).
composed example
o1 = new stzString("banana split")
? @@( o1.FindBoundedBy([ "an", "a" ]) )
#--> [ 4, 6 ]
composed from the signature, run for this page
QCSXTZZZIBWU
Same as IsBoundedByCS: IsBoundedByCS / IsBoundedBy: predicate. True iff the content starts with pacBounds[1] AND ends with pacBounds[2]. 6 examples run
# braced
? StzStringQ("{nnnnn}").IsBoundedBy([ "{", "}" ])
o1 = new stzString("بسم الله الرّحمن الرّحيم")
# opens with bism, closes with arrahim
? o1.IsBoundedBy([ "بسم", "الرّحيم" ])
#--> 1
#--> 1
library testQCSXTZZZIBWU
FindDuplicatesAsSections
(no comment in the source: the name reads as a sentence) find duplicates as sectionsin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? @@( o1.FindDuplicatesAsSections() )
#--> [ [ 4, 4 ], [ 4, 5 ], [ 4, 6 ], [ 5, 5 ], [ 5, 6 ], [ 6, 6 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) find chars w 4 examples runin the section finder delegations (expanded)
# FindCharsW reports the positions of "I"
? @@( Q("KALIDIA").FindCharsW('@char = "I"') )
#--> [ 4, 6 ]
library testQCSXTZZZIBWU
CharsBetween
The chars between the two given positions, as a list.
composed example
o1 = new stzString("banana split")
? o1.CharsBetween(2, 5)
#--> na
composed from the signature, run for this page
no extension
FindFirstRegex
(no comment in the source: the name reads as a sentence) find first regexalso written: FindRegexin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? o1.FindFirstRegex("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWU
FindAllRegex
(no comment in the source: the name reads as a sentence) find all regexalso written: FindAllRegexMatchesin the section finder delegations (expanded)
composed example
o1 = new stzString("banana split")
? @@( o1.FindAllRegex("an") )
#--> [ 2, 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
ExtractPattern
Same as ExtractPatternCS: ENGINE-DIRECT regex EXTRACTION: the matched TEXT of every match in ONE call (emails, URLs, dates, IDs, hashtags). FindAllRegex returns match POSITIONS; this returns the matched substrings themselves. Was a Haro while-loop (MatchAt + CaptureText per match).also written: RegexMatches · ExtractMatches
composed example
o1 = new stzString("banana split")
? @@( o1.ExtractPattern("an") )
#--> [ "an", "an" ]
composed from the signature, run for this page
QCSXTZZZIBWU
ExtractEmails
Convenience extractors over ExtractPattern for the common entity types. Char classes ([0-9] etc.) are used instead of \d/\w to avoid Haro string escaping. Return the matched substrings.no extension
ExtractURLs
The URLs found in the string.no extension
ExtractIPv4Addresses
The IPv4 addresses found in the string.also written: ExtractIPAddressesno extension
ExtractHashtags
The #hashtags found in the string.no extension
ExtractMentions
The @mentions found in the string.no extension
ExtractDates
The dates found in the string (ISO or slashed form).no extension
ExtractTimes
The times found in the string.no extension
ExtractPhoneNumbers
The phone numbers found in the string.also written: ExtractPhonesno extension
ExtractPrices
The prices (currency symbol + number) found in the string.no extension
CountSubStrings
Note: NumberOfSubStrings / NumberOfSubStringsCS / NumberOfSubStringsU without args (combinatorial enumeration count) are defined at the class top with the SubStrings group; here we keep only the differently-named occurrence-count alias for clarity.
composed example
o1 = new stzString("banana split")
? o1.CountSubStrings("an")
#--> 2
composed from the signature, run for this page
no extension
Same as CountCS: How many times the given substring occurs. 5 examples runalso written: NumberOfOccurrences
composed example
o1 = new stzString("banana split")
? o1.Count("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWU
CountOverlapping
Same as CountOverlappingCS: How many times it occurs, counting OVERLAPPING matches.
composed example
o1 = new stzString("banana split")
? o1.CountOverlapping("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWU
CountLeadingChar
count leading / trailing char
composed example
o1 = new stzString("banana split")
? o1.CountLeadingChar("an")
#--> 0
composed from the signature, run for this page
no extension
CountTrailingChar
count leading / trailing char
composed example
o1 = new stzString("banana split")
? o1.CountTrailingChar("an")
#--> 0
composed from the signature, run for this page
no extension
CountRegex
How many matches of the given regex pattern.
composed example
o1 = new stzString("banana split")
? o1.CountRegex("an")
#--> 2
composed from the signature, run for this page
QCSXTZZZIBWU
IsEither
IsEither(a, :Or = b): TRUE when the content equals either value (string-side override; unwraps the :Or named param).
composed example
o1 = new stzString("banana split")
? o1.IsEither(3, 4)
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
split at -- dispatcher (case-sensitive by default) 2 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAt(" ") )
#--> [ "banana", "split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitBefore
Same as SplitBeforeCS: Split the string before each occurrence of the separator (it starts each new part).
composed example
o1 = new stzString("banana split")
? @@( o1.SplitBefore("an") )
#--> [ "b", "an", "ana split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitBefore positions / char- or substring-predicate variants. 2 examples run
# the pieces start at 4 and 8
? @@( Q("---4---8---").SplitBeforePositions([ 4, 8 ]) )
#--> [ "---", "4---", "8---" ]
library testno extension
Split so each given position ENDS a piece. 1 examples run
# the pieces end at 4 and 8
? @@( Q("---4---8---").SplitAfterPositions([ 4, 8 ]) )
#--> [ "---4", "---8", "---" ]
library testno extension
SplitBeforeCharsW(pcCondition): split into pieces that begin at each char where the predicate is TRUE. Engine-backed via FindCharsW (no eval). Replaces the retired SplitBeforeCharsWXT. 1 examples run
# SplitBeforeCharsW at the uppercase letters yields the words
? @@( Q("NoWomanNoCry").SplitBeforeCharsW('Q(@char).IsUppercase()') )
#--> [ "No", "Woman", "No", "Cry" ]
library testno extension
SplitAfterCharsW
Split after each char satisfying the W condition.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAfterCharsW("@char = 'a'") )
#--> [ "ba", "na", "na", " split" ]
composed from the signature, run for this page
no extension
SplitBeforeSubStringsW
SplitBeforeSubStringsW(pcCondition): split before each substring matching the predicate. Engine-backed (see _SubStringMatchPositions), no eval(). Replaces the retired SplitBeforeSubStringsWXT.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitBeforeSubStringsW("@char = 'a'") )
#--> [ "banana split" ]
composed from the signature, run for this page
no extension
SplitAfterSubStringsW
Split after each substring matching the W condition.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAfterSubStringsW("@char = 'a'") )
#--> [ "banana split" ]
composed from the signature, run for this page
no extension
SplitAtSubStringsW
SplitAtSubStringsW(pcCondition): split AT the substrings matching the predicate -- the matched substrings are dropped (delimiters), the pieces between are returned. Engine-backed (W) and anonymous-function (WF) forms, no eval().
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAtSubStringsW("@char = 'a'") )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWUF
SplitAfter
Same as SplitAfterCS: Split the string after each occurrence of the separator (the separator stays with its part).
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAfter("an") )
#--> [ "ban", "an", "a split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitAround
Same as SplitAroundCS: The pieces between the occurrences of pcSubStr (codepoint-aware).also written: SplitAroundSubString
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAround("an") )
#--> [ "b", "", "a split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
Partition
The [before, match, after] triple around the FIRST occurrence.
composed example
o1 = new stzString("banana split")
? @@( o1.Partition("an") )
#--> [ "b", "an", "ana split" ]
composed from the signature, run for this page
no extension
RPartition
The [before, match, after] triple around the LAST occurrence.
composed example
o1 = new stzString("banana split")
? @@( o1.RPartition("an") )
#--> [ "ban", "an", "a split" ]
composed from the signature, run for this page
no extension
SplitByRegex
Split the string on the matches of the given regex pattern.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitByRegex("an") )
#--> [ "b", "", "a split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SplitAtPosition
Split the string at the given position.
composed example
o1 = new stzString("banana split")
? @@( o1.SplitAtPosition(2) )
#--> [ "b", "nana split" ]
composed from the signature, run for this page
no extension
SplitAtPositions
Split the string at the given positions.no extension
InsertBeforeSubString
Same as InsertBeforeSubStringCS: inserting before / after all occurrences
composed example
o1 = new stzString("banana split")
o1.InsertBeforeSubString("an", "an")
? o1.Content()
#--> banananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertAfterSubString
Same as InsertAfterSubStringCS: inserting before / after all occurrences
composed example
o1 = new stzString("banana split")
o1.InsertAfterSubString("an", "an")
? o1.Content()
#--> banananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertBeforeFirst
Same as InsertBeforeFirstCS: inserting before first / last occurrence
composed example
o1 = new stzString("banana split")
o1.InsertBeforeFirst("an", "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertAfterFirst
Same as InsertAfterFirstCS: inserting after first / last occurrence
composed example
o1 = new stzString("banana split")
o1.InsertAfterFirst("an", "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertBeforeLast
Same as InsertBeforeLastCS: inserting before first / last occurrence
composed example
o1 = new stzString("banana split")
o1.InsertBeforeLast("an", "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertAfterLast
Same as InsertAfterLastCS: inserting after first / last occurrence
composed example
o1 = new stzString("banana split")
o1.InsertAfterLast("an", "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertBeforeNth
Same as InsertBeforeNthCS: inserting before nth occurrence
composed example
o1 = new stzString("banana split")
o1.InsertBeforeNth(2, "an", "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
InsertAfterNth
Same as InsertAfterNthCS: inserting after nth occurrence
composed example
o1 = new stzString("banana split")
o1.InsertAfterNth(2, "an", "an")
? o1.Content()
#--> bananana split
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveCharAt
Same as RemoveSection: Remove the chars at positions n1..n2 (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveCharAt(2)
? o1.Content()
#--> bnana split
composed from the signature, run for this page
no extension
RemoveAtPosition
Same as RemoveSection: Remove the chars at positions n1..n2 (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveAtPosition(2)
? o1.Content()
#--> bnana split
composed from the signature, run for this page
no extension
RemoveSpaces
Remove all the spaces (mutating).
composed example
o1 = new stzString("banana split")
o1.RemoveSpaces()
? o1.Content()
#--> bananasplit
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveSpacesInSections
RemoveSpacesInSections(aSections): remove every space inside the given [n1, n2] sections. Walks sections in descending start-pos order so earlier sections stay valid after later edits.QCSXTZZZIBWU
RemoveLeadingSpaces
Same as TrimLeft: Remove the leading spaces in place (mutating). For a copy, use TrimmedLeft.no extension
RemoveTrailingSpaces
Same as TrimRight: Remove the trailing spaces in place (mutating). For a copy, use TrimmedRight.no extension
WithoutSpaces / SpacesRemoved: return the content with every space character removed, without mutating This. Ported from archive line 89601-89614. 1 examples runalso written: WithoutSapces · WithoutSpaces
composed example
o1 = new stzString("banana split")
? o1.SpacesRemoved()
#--> bananasplit
composed from the signature, run for this page
QCSXTZZZIBWU
Same as SubStringsSpacifiedCS: SubStringsSpacifiedCS / TheseSubstringsSpacifiedCS: wrap every occurrence of any substring in pacSubStr with spaces in the string content, return result. Used by stzCCode.Transpile to normalise token boundaries for downstream regex passes. Ported from archive line 91253; implementation collapses to a simple repeated substr-replace (Haro's built-in is global). Case-insensitive path uses a case-folded scan + position-aware splice so the result preserves the original casing of non-matched chars. 2 examples runalso written: TheseSpacified · TheseSubstringsSpacified
o1 = new stzString("iloveringprogramminglanguage")
? o1.TheseSubStringsSpacified([ "php", "ruby" ]) # Nothing happens because these substrings
#--> iloveringprogramminglanguage
library testQCSXTZZZIBWU
Same as SpacifySubStringsUsingCS: SpacifySubStringsUsing: in-place variant of SubStringsSpacified that lets the caller choose the separator (default would be a single space; this form makes it explicit). Wraps every occurrence of each substring in pacSubStr with the given separator on both sides. SpacifySubStringsUsingCS: find ALL the substrings' sections at once (sorted), drop the ones strictly included in their predecessor (so "in" inside "Haro" survives as part of "Haro"), bound each kept section with the separator on BOTH sides, then collapse duplicate separators (adjacent tokens share one) and strip them from the edges. Satisfies the archive triple: blocks 133, 306, 307. 2 examples run
o1 = new stzString("whatisyournameplease?")
o1.SpacifySubStringsUsing(["is", "your", "name"], "_")
? o1.Content()
#--> what_is_your_name_please?
library testQCSXTZZZIBWU
SpacifySubStringUsing
Separate the chars of pcSub inside the string with the given separator (mutating).no extension
SpacifySubStrings
Spacify every occurrence of the given substrings (mutating).no extension
AddXT(cBoth, :Around = "p") Shortcut for [cBoth, cBoth] -- same separator on both sides. 14 examples run
o1 = new stzString("__♥__♥__♥__")
o1.AddXT(" ", :AroundEach = "♥")
# every heart breathes
? o1.Content()
#--> __ ♥ __ ♥ __ ♥ __
library testQCSXTZZZIBWU
FindAnySubStringBoundedByZZ
Same as FindSubStringsBoundedByZZ: FindSubStringsBoundedByZZ: exclusive-bounds variant. Returns the position-pair list for the INNER content (without the bound chars). Derived from the IB result by shifting the start past the open token and the end before the close token.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAnySubStringBoundedByZZ([ "an", "a" ]) )
#--> [ [ 4, 3 ] ]
composed from the signature, run for this page
no extension
FindAnySubStringsBoundedByZZ
Same as FindSubStringsBoundedByZZ: FindSubStringsBoundedByZZ: exclusive-bounds variant. Returns the position-pair list for the INNER content (without the bound chars). Derived from the IB result by shifting the start past the open token and the end before the close token.
composed example
o1 = new stzString("banana split")
? @@( o1.FindAnySubStringsBoundedByZZ([ "an", "a" ]) )
#--> [ [ 4, 3 ] ]
composed from the signature, run for this page
no extension
RemoveThisTrailingChar: strip repeated trailing occurrences of a single given char. "abc!!" + RemoveThisTrailingChar("!") -> "abc". Ported from the legacy monolithic archive (~line 27306-27389); standalone byte-level implementation that avoids cascading dependencies on FindRepeatedTrailingChars*. 1 examples run
o1 = new stzString("12.4560000")
o1.RemoveThisTrailingChar("0")
# mutated in place
? o1.Content()
# or functionally
? Q("12.45600").ThisTrailingCharRemoved("0")
#--> 12.456
#--> 12.456
library testQCSXTZZZIBWU
A copy with the trailing run of the given char removed. 1 examples run
o1 = new stzString("12.4560000")
o1.RemoveThisTrailingChar("0")
# mutated in place
? o1.Content()
# or functionally
? Q("12.45600").ThisTrailingCharRemoved("0")
#--> 12.456
#--> 12.456
library testno extension
ThisLeadingCharRemoved
A copy with the leading run of the given char removed.no extension
RemoveThisRepeatedTrailingChar
Same as RemoveThisTrailingChar: RemoveThisTrailingChar: strip repeated trailing occurrences of a single given char. "abc!!" + RemoveThisTrailingChar("!") -> "abc". Ported from the legacy monolithic archive (~line 27306-27389); standalone byte-level implementation that avoids cascading dependencies on FindRepeatedTrailingChars*.QCSXTZZZIBWU
RemoveThisTrailingRepeatedChar
Same as RemoveThisTrailingChar: RemoveThisTrailingChar: strip repeated trailing occurrences of a single given char. "abc!!" + RemoveThisTrailingChar("!") -> "abc". Ported from the legacy monolithic archive (~line 27306-27389); standalone byte-level implementation that avoids cascading dependencies on FindRepeatedTrailingChars*.QCSXTZZZIBWU
Remove the leading run of the given char from the start of the string (mutating, codepoint-aware). 2 examples run
o1 = new stzString("000122.12")
# the leading char
? o1.LeadingChar()
o1.RemoveThisLeadingChar("0")
# the run is gone
? o1.Content()
#--> 0
#--> 122.12
library testQCSXTZZZIBWU
RemoveDuplicates
Same as RemoveDuplicatesCS: Remove the 2nd+ occurrences of each duplicated char, keeping the first (mutating).QCSXTZZZIBWU
Same as RemoveFromLeftCS: removing substring from left / right 1 examples run
o1 = new stzString("let's say welcome to everyone!")
o1.RemoveFromLeft("let's say ")
# the lead is gone
? o1.Content()
#--> welcome to everyone!
library testQCSXTZZZIBWU
Same as RemoveFromRightCS: Remove pcSubStr from the visual RIGHT end (direction-aware, mutating). 1 examples run
o1 = new stzString("هذه الكلمات الّتي سوف تبقى")
# the right 4 chars open the text
? o1.NRightCharsAsSubstring(4)
o1.RemoveFromRight("هذه ")
# removing from the right trims the start
? o1.Content()
#--> هذه
#--> الكلمات الّتي سوف تبقى
library testQCSXTZZZIBWU
Remove nRange chars starting at nStart (mutating). 1 examples run
o1 = new stzString("extrasection")
o1.RemoveRange(1, 5)
# range removed
? o1.Content()
#--> section
library testno extension
FindDuplicates
FindDuplicates -- positions of duplicated chars in the content. A char is "duplicated" if it appears more than once anywhere. Returns the 2nd+ occurrence positions (so the FIRST occurrence is not reported, matching stzList.FindDuplicates semantics).also written: DuplicationsZ · DuplicateCharsZ
composed example
o1 = new stzString("banana split")
? @@( o1.FindDuplicates() )
#--> [ 4, 5, 6 ]
composed from the signature, run for this page
QCSXTZZZIBWU
Same as FindDupSecutiveCharsCS: ENGINE-BACKED (StzEngineStringFindDupSecutiveCharsCS): positions of each char equal to the one before it. Retires the O(len) CharAt loop. pCaseSensitive=0 compares case-insensitively (per-codepoint casefold). 3 examples runalso written: DupSecutiveCharsZ
oA = new stzString("a")
s = new stzString( oA.Repeated(1000) )
# ConsecutiveSubStrings count is 375,250
? len(s.ConsecutiveSubStrings())
# FindDupSecutiveChars is 999 (positions 2..1000)
? len(s.FindDupSecutiveChars())
#--> 375250
#--> 999
library testQCSXTZZZIBWU
Same as FindDupSecutiveSubStringCS: FindDupSecutiveSubString: positions where the substring at i+1 equals the substring of the same length ending at i (i.e. back-to-back identical substrings). Returns the start positions of the second copy in each consecutive pair. ENGINE-BACKED (StzEngineStringFindDupSecutiveSubStringCS): start of the second copy in each back-to-back identical-substring pair. Retires the O(len) Haro while-loop (2 EngineSlice round-trips per step). pCaseSensitive=0 compares the substrings case-insensitively. 1 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.FindDupSecutiveSubString("an") )
#--> [ 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
DupSecutiveSubStringZ
DupSecutiveSubStringZ(sub): the substring grouped with the positions of its consecutive-duplicate occurrences.
composed example
o1 = new stzString("banana split")
? @@( o1.DupSecutiveSubStringZ("an") )
#--> [ "an", [ 4 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
DupSecutiveSubStrings
The plural family: every substring that occurs duplicated back-to-back somewhere in the string (derived, per the original monolith, from the consecutive-duplicate items of the phase-tiled ConsecutiveSubStrings() list), with the positions/sections of the duplicate occurrences. NOTE (engine backlog): O(n^2) Haro-side enumeration -- move the window scan + dup detection engine-side.
composed example
o1 = new stzString("banana split")
? @@( o1.DupSecutiveSubStrings() )
#--> [ "na", "an" ]
composed from the signature, run for this page
QCSXTZZZIBWU
FindDupSecutiveSubStrings
(no comment in the source: the name reads as a sentence) find dup secutive sub stringsin the section find first starting at
composed example
o1 = new stzString("banana split")
? @@( o1.FindDupSecutiveSubStrings() )
#--> [ 5, 4 ]
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveDupSecutiveSubStrings
(no comment in the source: the name reads as a sentence) remove dup secutive sub stringsin the section find first starting at
composed example
o1 = new stzString("banana split")
o1.RemoveDupSecutiveSubStrings()
? o1.Content()
#--> ban split
composed from the signature, run for this page
QCSXTZZZIBWU
DupSecutiveSubStringsRemoved
(no comment in the source: the name reads as a sentence) dup secutive sub strings removedin the section find first starting at
composed example
o1 = new stzString("banana split")
? o1.DupSecutiveSubStringsRemoved()
#--> ban split
composed from the signature, run for this page
no extension
FindBetween
FindBetween(pcSub, pcOpen, pcClose): the positions of pcSub when it appears between pcOpen .. pcClose bounded sections. Convenience wrapper over FindSubStringBoundedBy. FindBetween(sub, open, close): every occurrence of sub ANYWHERE INSIDE a bounded region (containment -- unlike FindSubStringBoundedBy, which requires sub to BE the region).QCSXTZZZIBWU
ContainsAt(p1, p2): does the content contain p2 at position p1? Two shapes supported by narratives: ContainsAt(nPos, pcSub) ContainsAt(pcSub, :Position = nPos) ContainsAt(anPositions, pcSub) -- ContainsAtPositions 3 examples runalso written: ContainsAtPositions
# hearts sit at 2, 5, 8
? Q("^♥^^♥^^♥^").ContainsAtPositions([ 2, 5, 8 ], "♥")
# a heart sits at position 1
? Q("♥^^♥^^♥").ContainsAtPosition("♥", 1)
#--> 1
#--> 1
library testno extension
(no comment in the source: the name reads as a sentence) contains at position 1 examples runin the section find first starting at
# hearts sit at 2, 5, 8
? Q("^♥^^♥^^♥^").ContainsAtPositions([ 2, 5, 8 ], "♥")
# a heart sits at position 1
? Q("♥^^♥^^♥").ContainsAtPosition("♥", 1)
#--> 1
#--> 1
library testno extension
Letters
Letters() / LettersQ(): characters that are letters. Engine- backed: filters the codepoint list by IsLetter() (Unicode-aware).
composed example
o1 = new stzString("banana split")
? @@( o1.Letters() )
#--> [ "b", "a", "n", "a", "n", "a", "s", "p", "l", "i", "t" ]
composed from the signature, run for this page
QCSXTZZZIBWU
NumberOfLetters
(no comment in the source: the name reads as a sentence) number of lettersin the section find first starting at
composed example
o1 = new stzString("banana split")
? o1.NumberOfLetters()
#--> 11
composed from the signature, run for this page
no extension
Interpolated
FindWXT: predicate-driven find positions; @char binding. (FindWXT removed -- FindW is the single engine-backed form; it accepts the expressive { } / Q(@char).Method() predicates with no eval. See FindW/FindWCS.) Interpolated(paBindings): replace each `${key}` placeholder in This with the corresponding value from paBindings (a hashlist of [:key, value] pairs).QCSXTZZZIBWU
AllCharsAre(pcKind): every char matches the given predicate (which is a symbolic kind like :Chars, :Numbers, :Letters, :Punctuations, :Arabic, :RightToLeft, :Invertible). Engine-backed where the helper exists; falls back to isalpha / isDigit otherwise. 3 examples run
# the plural kind
? Q("①②③").AllCharsAre(:CircledNumbers)
# the XT list of kinds
? Q("①②③").AllCharsAreXT([:CircledNumber, :Chars], [])
#--> 1
#--> 1
library testQCSXTZZZIBWU
IsPluralOfAStzType: predicate checking a :stz<Type>s symbolic name (e.g. :stzListsOfStrings, :stzStrings). Used by narratives that introspect Softanza type symbols. 1 examples runalso written: IsPluralOfStzType
# stzchars is a plural of a stz type
? Q("stzchars").IsPluralOfAStzType()
# ... specifically of stzchar
? Q("stzchars").IsPluralOfThisStzType("stzchar")
#--> 1
#--> 1
library testno extension
AllCharsAreEven
AllCharsAre extension: :Even / :Odd / :Positive for digits. Augment the existing kind list via inline checks.
composed example
o1 = new stzString("banana split")
? o1.AllCharsAreEven()
#--> 0
composed from the signature, run for this page
no extension
AllCharsAreOdd
(no comment in the source: the name reads as a sentence) all chars are oddin the section find first starting at
composed example
o1 = new stzString("banana split")
? o1.AllCharsAreOdd()
#--> 0
composed from the signature, run for this page
no extension
AllCharsArePositive
(no comment in the source: the name reads as a sentence) all chars are positivein the section find first starting at
composed example
o1 = new stzString("banana split")
? o1.AllCharsArePositive()
#--> 0
composed from the signature, run for this page
no extension
IsNotEqualTo
TRUE if the content differs from the given string. (case-sensitive by default)
composed example
o1 = new stzString("banana split")
? o1.IsNotEqualTo("an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
IsLessThan
TRUE if the string sorts BEFORE the given one.
composed example
o1 = new stzString("banana split")
? o1.IsLessThan("an")
#--> 0
composed from the signature, run for this page
no extension
IsGreaterThan
TRUE if the string sorts AFTER the given one.
composed example
o1 = new stzString("banana split")
? o1.IsGreaterThan("an")
#--> 1
composed from the signature, run for this page
no extension
LevenshteinDistanceWith
The Levenshtein edit distance to the given string.also written: EditDistanceWith
composed example
o1 = new stzString("banana split")
? o1.LevenshteinDistanceWith("an")
#--> 10
composed from the signature, run for this page
no extension
CommonPrefixWith
Same as CommonPrefixWithCS: common prefix / suffixQCSXTZZZIBWU
CommonSuffixWith
Same as CommonSuffixWithCS: common prefix / suffixQCSXTZZZIBWU
DiffWith
The differences between the string and the given one.
composed example
o1 = new stzString("banana split")
? @@( o1.DiffWith("an") )
#--> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
composed from the signature, run for this page
no extension
JaroSimilarityWith
jaro / jaro-winkler similarity
composed example
o1 = new stzString("banana split")
? o1.JaroSimilarityWith("an")
#--> 722
composed from the signature, run for this page
no extension
JaroWinklerSimilarityWith
jaro / jaro-winkler similarity
composed example
o1 = new stzString("banana split")
? o1.JaroWinklerSimilarityWith("an")
#--> 722
composed from the signature, run for this page
no extension
Soundex
The Soundex phonetic code of the string.
composed example
o1 = new stzString("banana split")
? o1.Soundex()
#--> B521
composed from the signature, run for this page
no extension
Metaphone
The Metaphone phonetic code of the string.
composed example
o1 = new stzString("banana split")
? o1.Metaphone()
#--> BNNSPL
composed from the signature, run for this page
no extension
The (dominant) script of the string. 2 examples run
# Inherited
? StzStringQ(" 4  " + ArabicDhammah() + "  ").Script()
#--> inherited
library testno extension
Scripts
The scripts used in the string.
composed example
o1 = new stzString("banana split")
? @@( o1.Scripts() )
#--> [ "latin", "common" ]
composed from the signature, run for this page
no extension
NumberOfScripts
How many scripts the string uses.
composed example
o1 = new stzString("banana split")
? o1.NumberOfScripts()
#--> 2
composed from the signature, run for this page
no extension
IsScriptOfText
callable on the stzString that TQ()/StzTextQ()/QQ() return)
composed example
o1 = new stzString("banana split")
? o1.IsScriptOfText("an")
#--> 0
composed from the signature, run for this page
no extension
IsLatinScript
TRUE if the string is written in the Latin script.
composed example
o1 = new stzString("banana split")
? o1.IsLatinScript()
#--> 1
composed from the signature, run for this page
no extension
IsArabicScript
TRUE if the string is written in the Arabic script.also written: IsArabic
composed example
o1 = new stzString("banana split")
? o1.IsArabicScript()
#--> 0
composed from the signature, run for this page
no extension
IsHanScript
TRUE if the string is written in the Han script.
composed example
o1 = new stzString("banana split")
? o1.IsHanScript()
#--> 0
composed from the signature, run for this page
no extension
IsHybridScript
TRUE if the string mixes several scripts.
composed example
o1 = new stzString("banana split")
? o1.IsHybridScript()
#--> 0
composed from the signature, run for this page
no extension
IsCommonScript
TRUE if the chars belong to the Common script.
composed example
o1 = new stzString("banana split")
? o1.IsCommonScript()
#--> 0
composed from the signature, run for this page
no extension
IsInheritedScript
TRUE if the chars belong to the Inherited script.
composed example
o1 = new stzString("banana split")
? o1.IsInheritedScript()
#--> 0
composed from the signature, run for this page
no extension
NthWord
The nth word of the text.
composed example
o1 = new stzString("banana split")
? o1.NthWord(2)
#--> split
composed from the signature, run for this page
no extension
FirstWord
The first word of the string.
composed example
o1 = new stzString("banana split")
? o1.FirstWord()
#--> banana
composed from the signature, run for this page
no extension
LastWord
The last word of the string.
composed example
o1 = new stzString("banana split")
? o1.LastWord()
#--> split
composed from the signature, run for this page
no extension
UniqueWords
Same as UniqueWordsCS: The unique words of the string.
composed example
o1 = new stzString("banana split")
? @@( o1.UniqueWords() )
#--> [ "banana", "split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
ContainsWord
Same as ContainsWordCS: TRUE if the string contains the given WORD (word-boundary aware).
composed example
o1 = new stzString("banana split")
? o1.ContainsWord("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
ReverseWords
Reverse the ORDER of the words in place (mutating).
composed example
o1 = new stzString("banana split")
o1.ReverseWords()
? o1.Content()
#--> split banana
composed from the signature, run for this page
no extension
SortWords
Same as SortWordsCS: Sort the words in place (mutating).QCSXTZZZIBWU
WordFrequency
Each word paired with its frequency.
composed example
o1 = new stzString("banana split")
? o1.WordFrequency("an")
#--> 0
composed from the signature, run for this page
no extension
MostFrequentWord
The word that occurs most often in the string.
composed example
o1 = new stzString("banana split")
? o1.MostFrequentWord()
#--> banana
composed from the signature, run for this page
no extension
MostFrequentWords
The top-N most frequent words as [[word, count], ...] (count desc). ENGINE-DIRECT one-pass word frequency -- the classic text-analytics workload (search indexing, tag clouds, NLP) that was O(unique x length).
composed example
o1 = new stzString("banana split")
? @@( o1.MostFrequentWords(2) )
#--> [ [ "banana", 1 ], [ "split", 1 ] ]
composed from the signature, run for this page
no extension
WordsAndTheirCounts
[[word, count], ...] for every distinct word (first-appearance order).
composed example
o1 = new stzString("banana split")
? @@( o1.WordsAndTheirCounts() )
#--> [ [ "banana", 1 ], [ "split", 1 ] ]
composed from the signature, run for this page
no extension
CharsAndTheirCounts
Same as CharsAndTheirCountsCS: [[char, count], ...] for every distinct character (first-appearance order).
composed example
o1 = new stzString("banana split")
? @@( o1.CharsAndTheirCounts() )
#--> [ [ "b", 1 ], [ "a", 3 ], [ "n", 2 ], [ " ", 1 ], [ "s", 1 ], [ "p", 1 ], [ "l", 1 ], [ "i", 1 ], [ "t", 1 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
MostFrequentChars
Same as MostFrequentCharsCS: The top-N most frequent characters as [[char, count], ...] (count desc).
composed example
o1 = new stzString("banana split")
? @@( o1.MostFrequentChars(2) )
#--> [ [ "a", 3 ], [ "n", 2 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
MostFrequentChar
The char that occurs most often in the string.
composed example
o1 = new stzString("banana split")
? o1.MostFrequentChar()
#--> a
composed from the signature, run for this page
no extension
NGramsAndTheirCounts
Same as NGramsAndTheirCountsCS: Sequences of n consecutive words (n=2 bigrams, 3 trigrams). Language modeling, autocomplete, collocation detection, plagiarism. [[ngram, count], ...] for every distinct n-gram (first-appearance order).
composed example
o1 = new stzString("banana split")
? @@( o1.NGramsAndTheirCounts(2) )
#--> [ [ "banana split", 1 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
MostFrequentNGrams
Same as MostFrequentNGramsCS: The top-N most frequent n-grams as [[ngram, count], ...] (count desc).
composed example
o1 = new stzString("banana split")
? @@( o1.MostFrequentNGrams(2, 5) )
#--> [ [ "banana split", 1 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
Collocations
Same as CollocationsCS: Word pairs that co-occur far more than chance ("machine learning", "New York"). nMinCount filters rare pairs. Returns top-N phrases by PMI.QCSXTZZZIBWU
MostSignificantCollocations
Same as CollocationsCS: Word pairs that co-occur far more than chance ("machine learning", "New York"). nMinCount filters rare pairs. Returns top-N phrases by PMI.
composed example
o1 = new stzString("banana split")
? @@( o1.MostSignificantCollocations(2) )
#--> [ "banana split" ]
composed from the signature, run for this page
no extension
CosineSimilarityWith
Same as CosineSimilarityWithCS: Bag-of-words cosine between this text and another: 1.0 = same term distribution, 0.0 = nothing shared. Plagiarism, near-duplicate, "find similar". (For corpus TF-IDF weighting see StzTFIDFKeywords.)also written: SimilarityWith
composed example
o1 = new stzString("banana split")
? o1.CosineSimilarityWith("an")
#--> 0
composed from the signature, run for this page
QCSXTZZZIBWU
AverageWordsPerSentence
Sentence = text up to each . ! ? terminator. All engine-direct, no materialization: averages come from cached engine counts; the extremes from one segmenting pass.
composed example
o1 = new stzString("banana split")
? o1.AverageWordsPerSentence()
#--> 2
composed from the signature, run for this page
no extension
AverageCharsPerSentence
The average number of chars per sentence.
composed example
o1 = new stzString("banana split")
? o1.AverageCharsPerSentence()
#--> 12
composed from the signature, run for this page
no extension
LongestSentenceInWords
The word count of the longest sentence.
composed example
o1 = new stzString("banana split")
? o1.LongestSentenceInWords()
#--> 2
composed from the signature, run for this page
no extension
ShortestSentenceInWords
The word count of the shortest sentence.
composed example
o1 = new stzString("banana split")
? o1.ShortestSentenceInWords()
#--> 2
composed from the signature, run for this page
no extension
How many sentences the string holds. 1 examples run
composed example
o1 = new stzString("banana split")
? o1.NumberOfSentences()
#--> 1
composed from the signature, run for this page
no extension
UAX#29 sentence segmentation (engine-backed), aligned with NumberOfSentences() -- correctly keeps "Dr. Smith", "3.14", "U.S.A." as one sentence rather than splitting on every '.'. Bulk native-list bridge (O(n)). 2 examples run
composed example
o1 = new stzString("banana split")
? @@( o1.Sentences() )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWUQQQQQ
The nth sentence of the string. 1 examples runno extension
FirstSentence
The first sentence of the string.no extension
LastSentence
The last sentence of the string.no extension
NumberOfParagraphs
How many paragraphs the string holds.
composed example
o1 = new stzString("banana split")
? o1.NumberOfParagraphs()
#--> 1
composed from the signature, run for this page
no extension
Paragraphs
The paragraphs of the string, as a list.
composed example
o1 = new stzString("banana split")
? @@( o1.Paragraphs() )
#--> [ "banana split" ]
composed from the signature, run for this page
no extension
NthParagraph
The nth paragraph of the string.no extension
Collapse the whitespace runs to single spaces (mutating). 2 examples run
o1 = new stzString("  lots   of    whitespace  ")
# edges trimmed
? o1.Trimmed()
# then squeezed and shouted
? o1.SimplifyQ().Uppercased()
#--> lots   of    whitespace
#--> LOTS OF WHITESPACE
library testQCSXTZZZIBWUExcept
A copy with the whitespace collapsed to single spaces; the original is unchanged. 2 examples run
? StzStringQ("ab []    cd").Simplified()
? Q(list2code([ "a", [ [] ], "b" ])).Simplified()
#--> ab [] cd
#--> [ "a", [ [ ] ], "b" ]
library testno extension
ToSlug
The string turned into a URL slug (lowercase, hyphens).
composed example
o1 = new stzString("banana split")
? o1.ToSlug()
#--> banana-split
composed from the signature, run for this page
no extension
Initials
The initial letter of each word.
composed example
o1 = new stzString("banana split")
? o1.Initials()
#--> bs
composed from the signature, run for this page
no extension
ToHex
The string's bytes in hexadecimal form.
composed example
o1 = new stzString("banana split")
? o1.ToHex()
#--> 62616e616e612073706c6974
composed from the signature, run for this page
no extension
FromHex
Set the content from its hex form (mutating).no extension
UrlEncoded
The string URL-encoded.no extension
UrlEncode
URL-encode the content in place (mutating).QCSXTZZZIBWU
UrlDecoded
The string URL-decoded.no extension
UrlDecode
URL-decode the content in place (mutating).QCSXTZZZIBWU
HtmlEncoded
The string with the HTML-special chars encoded as entities. Engine-backed. This built a per-character LIST of the whole string and concatenated onto a growing result -- the wrap-to-scan shape, quadratic in the string length. The engine does the same five substitutions (& < > " and ' -> &#39;) in one pass, and the bridge now sizes its buffer to fit rather than silently returning "" past 64 KB.no extension
HtmlEncode
HTML-encode the content in place (mutating).no extension
HtmlDecoded
The engine makes ONE left-to-right pass, consuming each entity whole and advancing past it, so a decoded '&' can never re-trigger a match. It also covers &apos; &nbsp; and numeric entities (&#NN; / &#xHH;), which the five-replace version silently left intact -- a widening, not a behaviour change for anything the old code handled.no extension
HtmlDecode
HTML-decode the content in place (mutating).no extension
ToBinary
The string's bytes in binary form.
composed example
o1 = new stzString("banana split")
? o1.ToBinary()
#--> 01100010 01100001 01101110 01100001 01101110 01100001 00100000 01110011 01110000 01101100 01101001 01110100
composed from the signature, run for this page
no extension
ToOctal
The string's bytes in octal form.
composed example
o1 = new stzString("banana split")
? o1.ToOctal()
#--> 142 141 156 141 156 141 040 163 160 154 151 164
composed from the signature, run for this page
no extension
EscapedForRegex
The string with the regex special chars escaped. One engine pass. This used to build a per-character LIST of the whole string (@oString.Chars()) and scan the metacharacter set for each one, which allocates a Haro object per character to answer a question about 14 ASCII bytes. Same set, same result.no extension
EscapeForRegex
Escape the regex special chars in place (mutating).no extension
NormalizeNFC
Normalize the content to Unicode NFC in place (mutating).no extension
NormalizedNFC
The string in Unicode NFC normal form.no extension
NormalizeNFD
Normalize the content to Unicode NFD in place (mutating).no extension
NormalizedNFD
The string in Unicode NFD normal form.no extension
NormalizeNFKC
Normalize the content to Unicode NFKC in place (mutating).no extension
NormalizedNFKC
The string in Unicode NFKC normal form.no extension
NormalizeNFKD
Normalize the content to Unicode NFKD in place (mutating).no extension
NormalizedNFKD
The string in Unicode NFKD normal form.no extension
The string in Title Case (each word capitalized). 1 examples run
# lowercased
? Q("tunis").Lowercased()
# uppercased
? Q("tunis").Uppercased()
# titlecased
? Q("tunis").Titlecased()
#--> tunis
#--> TUNIS
#--> Tunis
library testno extension
ApplyTitlecase
Titlecase the content in place (mutating).QCSXTZZZIBWU
CaseFolded
The string case-folded (aggressive lowercasing, for caseless comparison).no extension
LeftAlignXT
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).no extension
RightAlignXT
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).no extension
CenterAlignXT
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).no extension
LeftAligned
A copy aligned LEFT in a field of nWidth chars.no extension
RightAligned
A copy aligned RIGHT in a field of nWidth chars.no extension
CenterAligned
A copy CENTERED in a field of nWidth chars.no extension
PadLeft
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).no extension
PadRight
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).no extension
PaddedLeft
A copy padded on the left to nWidth with the given char.also named: pad on the left right-align fill to width left-padno extension
PaddedRight
A copy padded on the right to nWidth with the given char.no extension
Same as RepeatedLeadingCharsCS: Repeated*Chars return the run as a LIST of chars ([] when there is no run); the *SubString twins give it as a string. 1 examples run
o1 = new stzString("exeeeeeTUNIS")
# no repeated leading char
? o1.RepeatedLeadingChar()
# empty list
? len( o1.RepeatedLeadingChars() )
#--> 0
library testQCSXTZZZIBWU
RepeatedTrailingChars
Same as RepeatedTrailingCharsCS: The trailing repeated-char run, as a list (case dial).QCSXTZZZIBWU
Same as RemoveRepeatedLeadingCharsCS: ensure prefix / suffix 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveRepeatedLeadingChars()
? o1.Content()
#--> anana split
composed from the signature, run for this page
QCSXTZZZIBWU
Same as RemoveRepeatedTrailingCharsCS: ensure prefix / suffix 1 examples run
composed example
o1 = new stzString("banana split")
o1.RemoveRepeatedTrailingChars()
? o1.Content()
#--> banana spli
composed from the signature, run for this page
QCSXTZZZIBWU
EnsurePrefix
Same as EnsurePrefixCS: ensure prefix / suffixQCSXTZZZIBWU
EnsureSuffix
Same as EnsureSuffixCS: ensure prefix / suffixQCSXTZZZIBWU
Same as RemoveFromStartCS: removing from start / end 2 examples runQCSXTZZZIBWU
Remove pcSuffix from the end of the string when it ends with it (mutating). 2 examples run
o1 = new stzString("programming*")
o1.RemoveFromEnd("*")
# bare word
? o1.Content()
#--> programming
library testQCSXTZZZIBWU
RemovedFromEnd
Same as RemovedFromEndCS: Immutable / past-tense companions: return the modified content without mutating This. Used by stzNumber.RoundTo() and similar fluent chains that want the result as a value.QCSXTZZZIBWU
NthLine
The nth line of the string.no extension
FirstLine
Same as NthLine: The nth line of the string.no extension
LastLine
The last line of the string.no extension
UniqueLines
Same as UniqueLinesCS: The unique lines of the string.
composed example
o1 = new stzString("banana split")
? @@( o1.UniqueLines() )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
SortLines
Same as SortLinesCS: Sort the lines in place (mutating).QCSXTZZZIBWU
RemoveBlankLines
Remove the blank lines (mutating).no extension
LinesContaining
Same as LinesContainingCS: The lines containing the given substring.
composed example
o1 = new stzString("banana split")
? @@( o1.LinesContaining("an") )
#--> [ "banana split" ]
composed from the signature, run for this page
QCSXTZZZIBWU
Same as TrimCharCS: trimming a specific char 1 examples run
o1 = new stzString("♥♥♥123♥♥♥")
o1.TrimChar("♥")
# bare digits
? o1.Content()
#--> 123
library testQCSXTZZZIBWU
TrimLeftChar
Same as TrimLeftCharCS: Trim the run of the given char from the START (mutating).QCSXTZZZIBWU
TrimRightChar
Same as TrimRightCharCS: Trim the run of the given char from the END (mutating).QCSXTZZZIBWU
IsNeither
Same as IsNeitherCS: IsNeither: TRUE when this string equals neither argument (the -- :Nor named-param spells the second). Restored from the monolith.
composed example
o1 = new stzString("banana split")
? o1.IsNeither("an", "an")
#--> 1
composed from the signature, run for this page
QCSXTZZZIBWU
RemoveAnyCharFromLeft/Right: strip the whole leading/trailing run -- of a given char (aliases of RemoveCharFromLeft/Right). 1 examples runno extension
Same as RemoveCharFromRight: Drop the trailing chars matching pcChar from the end of the string (mutating). 1 examples runno extension
Each Softanza class overrides StzType() to report its own type -- (the base stzObject returns :stzObject). Restored for stzString. 4 examples run
? Q("ABC") * 3
? ( Q("ABC") * Q(3) ).StzType() + NL
? ( Q("ABC") * Q(3) ).Lowercased()
? Q("ABC") * " -> "
? ( Q("ABC") * Q(" -> ") ).Lowercased()
#--> ABCABCABC
#--> stzstring
#--> abcabcabc
#--> A -> B -> C ->
#--> ...
library testno extension
IsLanguageIdentifier
Locale identifier predicates (thin OR-combinators over the existing -- name/abbreviation/number locale checks). Used by stzList's -- IsLocaleList / IsMultilingualString.
composed example
o1 = new stzString("banana split")
? o1.IsLanguageIdentifier()
#--> 0
composed from the signature, run for this page
no extension
IsScriptIdentifier
TRUE if the string identifies a script (number, code or abbreviation).
composed example
o1 = new stzString("banana split")
? o1.IsScriptIdentifier()
#--> 0
composed from the signature, run for this page
no extension
IsCountryIdentifier
TRUE if the string identifies a country (number, code, name...).
composed example
o1 = new stzString("banana split")
? o1.IsCountryIdentifier()
#--> 0
composed from the signature, run for this page
no extension
IsLanguageNameOrAbbreviation
TRUE if the string is a language name or abbreviation.
composed example
o1 = new stzString("banana split")
? o1.IsLanguageNameOrAbbreviation()
#--> 0
composed from the signature, run for this page
no extension