Sous chaque méthode, ses extensions (Q CS XT Z ZZ IB W U) : en gras et cochée, elle existe ; barrée, elle n'existe pas. Les extensions et leur sens
Exemples : 220 viennent des tests de la bibliothèque ; 586 ont été composés à partir de la signature de chaque méthode et exécutés pour cette page, sur un objet neuf, par exemple o1 = new stzString("banana split"). 312 méthodes n'en ont pas encore. Exemples exécutés le 2026-10-03 20:34 dans la bibliothèque au commit 0e72e2e2c.
Méthode
Explication, telle que la source la porte
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".aucune extension
init
Build the string object from the given Haro string.aucune 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 exemples exécutésaussi écrite: Text · AsWell · String · ToString · TheString · Stringified · DeepStringifieddans la section getting content of the stringo1 = 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" ] ]test de la bibliothèqueQCSXTZZZIBWUInfereType
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.
exemple composé
o1 = new stzString("banana split")
? o1.InfereType()
#--> unknowncomposé à partir de la signature, exécuté pour cette page aucune extensionShow
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()`.aucune 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()`.aucune 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.aucune extension
LastBoundsOf
(sans commentaire dans la source : le nom se lit comme une phrase) last bounds ofdans la section getting content of the stringaucune extension
BoundsOfFirstOccurrence
(sans commentaire dans la source : le nom se lit comme une phrase) bounds of first occurrencedans la section getting content of the stringaucune 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.aucune extension
BoundsOfXT3
(sans commentaire dans la source : le nom se lit comme une phrase) bounds of xt3dans la section getting content of the stringaucune extension
Engine
getting the engine handleaucune extension
The length of the string in characters (Unicode codepoints).
11 exemples exécutésaussi nommée: length string length length of the string size how long count characters number of lettersaussi écrite: Lengthostr = new stzString("s㊱m")
? ostr.NumberOfChars()
? ostr[2]
#--> 3
#--> ㊱test de la bibliothèqueQCSXTZZZIBWUHasMoreCharsThan
(sans commentaire dans la source : le nom se lit comme une phrase) has more chars thanaussi écrite: IsLarger · HasMoreChars · IsLargerThanaussi acceptée: HasMoreChars(3) · HasMoreChars(:Than = 3) · HasMoreChars(:Then = 3)dans la section comparing size (number of chars)exemple composé
o1 = new stzString("banana split")
? o1.HasMoreCharsThan(3)
#--> 1composé à partir de la signature, exécuté pour cette page aucune extension HasLessCharsThan
(sans commentaire dans la source : le nom se lit comme une phrase) has less chars thanaussi écrite: IsSmaller · HasLessChars · HasFewerChars · IsSmallerThanaussi acceptée: HasLessChars(3) · HasLessChars(:Than = 3) · HasLessChars(:Then = 3)dans la section comparing size (number of chars)exemple composé
o1 = new stzString("banana split")
? o1.HasLessCharsThan(3)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension IsEmpty
Whether the string has no characters.
aussi nommée: empty blank is empty no characters nothing void blank empty has nothing no characters is it emptyexemple composé
o1 = new stzString("banana split")
? o1.IsEmpty()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsAChar
TRUE if the string is exactly one char long.
aussi écrite: IsCharexemple composé
o1 = new stzString("banana split")
? o1.IsChar()
#--> 0composé à partir de la signature, exécuté pour cette page · écrit IsAChar() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsChar(), et Haro supprime le détour aucune extensiongetting a copy of the string object
2 exemples exécutéso2 = 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 Gtest de la bibliothèqueaucune extensionUpdate
updating the string content
exemple composé
o1 = new stzString("banana split")
o1.Update("AN")
? o1.Content()
#--> ANcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUUndoStack
updating the string contentaucune extension
NthChar
The char at position n (codepoint-aware).
aussi écrite: CharAtexemple composé
o1 = new stzString("banana split")
? o1.NthChar(2)
#--> acomposé à partir de la signature, exécuté pour cette page aucune extensionThe first char of the string (codepoint-aware).
2 exemples exécutésaussi nommée: first character initial leading character opening charaussi écrite: LeftCharo1 = new stzString("ABC")
# first
? o1.FirstChar()
# last
? o1.LastChar()
#--> A
#--> Ctest de la bibliothèqueQCSXTZZZIBWUThe last char of the string (codepoint-aware).
2 exemples exécutésaussi nommée: last character final char trailing character ending charaussi écrite: RightCharo1 = new stzString("ABC")
# first
? o1.FirstChar()
# last
? o1.LastChar()
#--> A
#--> Ctest de la bibliothèqueQCSXTZZZIBWUThe chars of the string, as a list (codepoint-aware).
3 exemples exécutésaussi écrite: ToListOfCharsoAB = 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())
#--> 200000test de la bibliothèqueQCSXTZZZIBWUThe Unicode NAME of each char, as a list.
2 exemples exécutés? Q("◐◰☁").CharsNames()
#--> CIRCLE WITH LEFT HALF BLACK
#--> WHITE SQUARE WITH UPPER LEFT QUADRANT
#--> CLOUDtest de la bibliothèqueaucune extensionThe substring from position n1 to n2 (inclusive, codepoint-aware).
19 exemples exécutésaussi nommée: substring slice part portion extract characters between two positionsaussi écrite: Slice# 456
? StzStringQ("123456789").Section(4, 6)
#--> 456test de la bibliothèqueQCSXTZZZIBWUFirstHalf
FirstHalf / SecondHalf -- split the content in two equal halves (rounded down on odd length). FirstHalfXT returns trailing char.
exemple composé
o1 = new stzString("banana split")
? o1.FirstHalf()
#--> bananacomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSecondHalf
The second half of the string (the longer half when the length is odd).
exemple composé
o1 = new stzString("banana split")
? o1.SecondHalf()
#--> splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUHalves
Halves(): return [firstHalf, secondHalf] as a list of strings.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Halves() )
#--> [ "banana", " split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsCircledNumber
IsCircledNumber / IsCircledDigit -- Unicode-aware single-char predicates (Enclosed Alphanumerics block etc.).
aussi écrite: IsCircledDigitexemple composé
o1 = new stzString("banana split")
? o1.IsCircledNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionReplace 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 exemples exécutéso1 = new stzString("123--67--")
o1.ReplaceSection(1, 3, "~")
# collapsed
? o1.Content()
#--> ~--67--test de la bibliothèqueQCSXTZZZIBWUSections
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAntiSections("an") )
#--> [ "b", "a split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindAsAntiSections
FindAsAntiSections: the complement [start, end] spans (the gaps around the occurrences), not the gap substrings.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAsAntiSections("an") )
#--> [ [ 1, 1 ], [ 6, 12 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionAntiFindAsSections
AntiFindAsSections: the complement POSITION sections (the gaps between occurrences), e.g. [[1,3],[8,10]] -- not the substrings.
exemple composé
o1 = new stzString("banana split")
? @@( o1.AntiFindAsSections("an") )
#--> [ [ 1, 1 ], [ 6, 12 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURange
The substring starting at nStart and spanning nRange chars (lenient).
exemple composé
o1 = new stzString("banana split")
? o1.Range(2, 5)
#--> ananacomposé à partir de la signature, exécuté pour cette page aucune extensionIsLeftToRight
TRUE if the string runs left-to-right (bidi direction).
exemple composé
o1 = new stzString("banana split")
? o1.IsLeftToRight()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionWhether the string contains the given substring.
13 exemples exécutésaussi nommée: contain contains includes has contain a word is present occurs in includes has holds is there present in does it haveoS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]test de la bibliothèqueQCSXTZZZIBWUSame 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 exemples exécutésaussi écrite: 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
#--> ...test de la bibliothèqueQCSXTZZZIBWUThe first occurrence of the substring: the position(s).
9 exemples exécutésaussi écrite: FirstOccurrence · FindFirstSubString · FindFirstOccurrenceexemple composé
o1 = new stzString("banana split")
? o1.FindFirst("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSTDSame 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 exemples exécutésaussi écrite: FindNextSubStringo1 = new stzString("123456789")
# nothing at or after 10
? o1.FindNext("1", :startingAt = 10)
#--> 0test de la bibliothèqueQCSXTZZZIBWUST(sans commentaire dans la source : le nom se lit comme une phrase) find next nth 2 exemples exécutésdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.FindNextNth(2, "an", 5)
#--> 0composé à partir de la signature, exécuté pour cette 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.aussi écrite: 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).aucune extension
FirstNumberComingAfter
Same as NumberComingAfterCS: The FIRST number coming after the substring (NULL if none).aucune 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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.ToListOfStzChars() )
#--> [ @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname, @noname ]composé à partir de la signature, exécuté pour cette page aucune extensionHtmlEscaped
HtmlEscaped: escape `&`, `<`, `>`, `"`, `'` to HTML entities. Self-contained: no engine dependency, no external lookup.aussi écrite: HTMLEscape · EscapedHtmlaucune extension
ContainsInSection: does pcSubStr appear within the substring bounded by positions [n1, n2] (inclusive)?
3 exemples exécutésaussi écrite: ContainsBetweenPositions# a caret after position 2
? Q("^^♥^^").ContainsXT("^", :AfterPosition = 2)
# a caret in the 5..3 span (normalized)
? Q("^^♥^^").ContainsInSection("^", 5, 3)
#--> 1
#--> 1test de la bibliothèqueQCSXTZZZIBWUReplaceInSection: 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 exemples exécutés# 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 Hearttest de la bibliothèqueQCSXTZZZIBWUUppercaseSubString: uppercase a section or a named substring. Accepts: - UppercaseSubString(pcSub) : every occurrence - UppercaseSubString([n1, n2]) : 1-arg list form
1 exemples exécutéso1 = 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!test de la bibliothèqueQCSXTZZZIBWUShorten: 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.Shorten()
? o1.Content()
#--> ban...litcomposé à partir de la signature, exécuté pour cette page aucune extension(sans commentaire dans la source : le nom se lit comme une phrase) shortened n 2 exemples exécutésdans la 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 {...} 21test de la bibliothèqueaucune extension (sans commentaire dans la source : le nom se lit comme une phrase) shortened 2 exemples exécutésdans la 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 ... 321test de la bibliothèqueQCSXTZZZIBWU ShortenedUsing(pcEllipsis): keep first+last 3 chars, glued with the ellipsis.
1 exemples exécutés# ShortenedUsing(' {...} ') keeps 3 each side
? Q("1234567890987654321").ShortenedUsing(" {...} ")
# ShortenedNUsing(5, ' {...} ') keeps 5 each side
? Q("1234567890987654321").ShortenedNUsing(5, " {...} ")
#--> 123 {...} 321
#--> 12345 {...} 54321test de la bibliothèqueQCSXTZZZIBWUBoxify
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().
exemple composé
o1 = new stzString("banana split")
? o1.Boxify()
#--> ┌──────────────┐
#--> │ banana split │
#--> └──────────────┘composé à partir de la signature, exécuté pour cette page aucune extensionVowels
(sans commentaire dans la source : le nom se lit comme une phrase) vowelsdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? @@( o1.Vowels() )
#--> [ "a", "a", "a", "i" ]composé à partir de la signature, exécuté pour cette page aucune 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.Extend("x")
? o1.Content()
#--> banana splitxcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU(sans commentaire dans la source : le nom se lit comme une phrase) extend with 1 exemples exécutésdans la section essential find / contains / counto1 = new stzString("ABC")
o1.ExtendWith("DE")
# the content is now ABCDE
? o1.Content()
#--> ABCDEtest de la bibliothèqueQCSXTZZZIBWU ExtendToPosition
(sans commentaire dans la source : le nom se lit comme une phrase) extend to positiondans la section essential find / contains / countQCSXTZZZIBWU
ExtendToPositionWith
(sans commentaire dans la source : le nom se lit comme une phrase) extend to position withdans la section essential find / contains / countQCSXTZZZIBWU
RandomChar
Return a random char from the string content. Uniform random choice across char positions.aussi écrite: AChar · AnyChar · ARandomCharaucune 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.aucune extension
NumberOfVowels
(sans commentaire dans la source : le nom se lit comme une phrase) number of vowelsaussi écrite: VowelN · CountVowelsdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.NumberOfVowels()
#--> 4composé à partir de la signature, exécuté pour cette page aucune extension VowelNB
(sans commentaire dans la source : le nom se lit comme une phrase) vowel nbdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.VowelNB()
#--> 0composé à partir de la signature, exécuté pour cette page aucune 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()`.
aussi écrite: Vowelexemple composé
o1 = new stzString("banana split")
? o1.IsVowel()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHasVowels
(sans commentaire dans la source : le nom se lit comme une phrase) has vowelsaussi écrite: ContainsVowelsdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.HasVowels()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) vowels b 1 exemples exécutésdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.VowelsB()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) numbers 1 exemples exécutésdans la 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" ]test de la bibliothèqueQCSXTZZZIBWU SumOfNumbers
Data extraction: total amounts in an invoice/log, averages, ranges. A number = optional '-', digits, one optional '.' with more digits.
exemple composé
o1 = new stzString("banana split")
? o1.SumOfNumbers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionCountNumbers
(sans commentaire dans la source : le nom se lit comme une phrase) count numbersdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.CountNumbers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension MinNumber
(sans commentaire dans la source : le nom se lit comme une phrase) min numberdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.MinNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension MaxNumber
(sans commentaire dans la source : le nom se lit comme une phrase) max numberdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.MaxNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension AverageOfNumbers
(sans commentaire dans la source : le nom se lit comme une phrase) average of numbersaussi écrite: MeanOfNumbersdans la section essential find / contains / countexemple composé
o1 = new stzString("banana split")
? o1.AverageOfNumbers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) number of occurrence 2 exemples exécutésdans la section essential find / contains / countoS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]test de la bibliothèqueQCSXTZZZIBWU Find pcSubStr in the string: the positions of EVERY occurrence, as a list (engine-backed, codepoint-aware). (case-sensitive by default)
6 exemples exécutésaussi nommée: locate search for position of index of where isaussi écrite: FindAll · FindSubStringoS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]test de la bibliothèqueQCSXTZZZIBWUSTDManyExceptFindInSection
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 -> [].
aussi écrite: FindAllInSectionexemple composé
o1 = new stzString("banana split")
? @@( o1.FindInSection("an", 2, 5) )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUfind all / find nth
9 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindNth(2, "an")
#--> 4composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSTDThe last occurrence of the substring: the position(s).
9 exemples exécutéso1 = new stzString("•♥••••♥••")
# FindLast('♥') is 7
? o1.FindLast("♥")
# FindLast('_') (absent) is 0
? o1.FindLast("_")
#--> 7
#--> 0test de la bibliothèqueQCSXTZZZIBWUSTDStartsWith
Whether the string starts with the given prefix.
aussi nommée: starts with begins with prefix leading has prefix begins with prefix at the start opens withexemple composé
o1 = new stzString("banana split")
? o1.StartsWith("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUWhether the string ends with the given suffix.
1 exemples exécutésaussi nommée: ends with finishes with suffix trailing has suffix finishes with suffix at the end closes withexemple composé
o1 = new stzString("banana split")
? o1.EndsWith("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUPredicates: 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 exemples exécutésaussi écrite: EndsWithNumber · ContainsAFinalNumber · EndsWithAFinalNumber · ContainsAnEndingNumber · ContainsATrailingNumber · EndsWithATrailingNumberexemple composé
o1 = new stzString("banana split")
? o1.EndsWithANumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionstarts with / ends with
1 exemples exécutésaussi écrite: StartsWithNumber · StartsWithALeadingNumberexemple composé
o1 = new stzString("banana split")
? o1.StartsWithANumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionUppercase
Change the string to UPPER CASE in place (mutating). For a copy, use Uppercased.
exemple composé
o1 = new stzString("banana split")
o1.Uppercase()
? o1.Content()
#--> BANANA SPLITcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUAn UPPER CASE (all capitals) copy of the string; the original is unchanged.
3 exemples exécutésaussi nommée: upper case capitals all caps in capitals# lowercased
? Q("tunis").Lowercased()
# uppercased
? Q("tunis").Uppercased()
# titlecased
? Q("tunis").Titlecased()
#--> tunis
#--> TUNIS
#--> Tunistest de la bibliothèqueaucune extensionLowercase
Change the string to lower case in place (mutating). For a copy, use Lowercased.QCSXTZZZIBWU
InLowercase
Misspelled but historically-used aliasesaussi écrite: InLowarcaseQCSXTZZZIBWU
A lower case copy of the string; the original is unchanged.
7 exemples exécutésaussi nommée: 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 ->
#--> ...test de la bibliothèqueaucune extensionCapitalize
Capitalize the first letter in place (mutating). For a copy, use Capitalized.
exemple composé
o1 = new stzString("banana split")
o1.Capitalize()
? o1.Content()
#--> Banana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUCapitalized
A copy with the first letter capitalized (title-style); original unchanged.
aussi nommée: title case first letter capital sentence case proper caseexemple composé
o1 = new stzString("banana split")
? o1.Capitalized()
#--> Banana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionReverse
Reverse the order of the characters in the string, in place (mutating). For a copy that leaves the original unchanged, use Reversed.
exemple composé
o1 = new stzString("banana split")
o1.Reverse()
? o1.Content()
#--> tilps ananabcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUA copy of the string with the characters in reverse order; original unchanged.
3 exemples exécutésaussi nommée: backwards in reverse order mirrored flipped# digits flip
? Q("9876543210").Reversed()
#--> 0123456789test de la bibliothèqueaucune extensionReplace every occurrence of a substring with another.
22 exemples exécutésaussi nommée: replace substitute swap text find and replace change all rename substitute swap change find and replace put insteado1 = new stzString("R I N G")
o1.Replace(" ", "-")
# Replace() mutates the object
? o1.Content()
#--> R-I-N-Gtest de la bibliothèqueQCSXTZZZIBWUManySame as Replace: replace every occurrence of pcSubStr (mutating).
7 exemples exécutéso1 = new stzString("one two three four")
o1.ReplaceAll("two", "---")
# two became dashes
? o1.Content()
#--> one --- three fourtest de la bibliothèqueQCSXTZZZIBWUExceptSame as ReplacedCS: A copy with every occurrence of pcSubStr replaced by pcNewSubStr; the original is unchanged.
1 exemples exécutés? Q("tea, rice, tea").Replaced("tea", :With = "coffee")
#--> coffee, rice, coffeetest de la bibliothèqueQCSXTZZZIBWURemove every occurrence of pcSubStr from the string (mutating). For a copy, use Removed.
26 exemples exécutésaussi nommée: delete erase take out strip dropexemple composé
o1 = new stzString("banana split")
o1.Remove("an")
? o1.Content()
#--> ba splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUManyRemoveAll
Same as Remove: remove every occurrence of pcSubStr (mutating).
aussi nommée: delete strip erase get rid of take out dropexemple composé
o1 = new stzString("banana split")
o1.RemoveAll("an")
? o1.Content()
#--> ba splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUExceptReplaceNth
(sans commentaire dans la source : le nom se lit comme une phrase) replace nthdans la section replace nth / first / lastexemple composé
o1 = new stzString("banana split")
o1.ReplaceNth(2, "an", "AN")
? o1.Content()
#--> banANa splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) replace first 2 exemples exécutésdans la section replace nth / first / lastexemple composé
o1 = new stzString("banana split")
o1.ReplaceFirst("an", "AN")
? o1.Content()
#--> bANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU ReplaceLast
(sans commentaire dans la source : le nom se lit comme une phrase) replace lastdans la section replace nth / first / lastexemple composé
o1 = new stzString("banana split")
o1.ReplaceLast("an", "AN")
? o1.Content()
#--> banANa splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) replace by many 3 exemples exécutésdans la section replace nth / first / lasto1 = new stzString("--*--*--*--")
o1.ReplaceByMany("*", [ "ONE", "TWO", :And = "THREE" ])
# one word per star
? o1.Content()
#--> --ONE--TWO--THREE--test de la bibliothèqueQCSXTZZZIBWU 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 exemples exécutéso1 = 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>>test de la bibliothèqueQCSXTZZZIBWUReplaceSubStringBoundedBy(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 exemples exécutésQCSXTZZZIBWUReplaceSubStringAtPosition
ReplaceSubStringAtPosition(n, pcOld, pcNew): replace pcOld with pcNew only at character position n (so pcOld must start at n).
exemple composé
o1 = new stzString("banana split")
o1.ReplaceSubStringAtPosition(2, "an", "AN")
? o1.Content()
#--> bANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceAt
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.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceAt(2, "an", "AN")
? o1.Content()
#--> bANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceCharAt(:Position = n, :By = pcNew) -- named-param variant of ReplaceAt for char-at-position replacement.
2 exemples exécutéso1 = new stzString("ABC*EF")
o1.ReplaceCharAt(:Position = 4, :By = "D")
# the star became D
? o1.Content()
#--> ABCDEFtest de la bibliothèqueQCSXTZZZIBWUReplaceCharAtSimple
ReplaceCharAt(n, pcNew) -- single-char-at-position form. (Named-param :Position/:By form lives at ReplaceCharAt2 above.)
exemple composé
o1 = new stzString("banana split")
o1.ReplaceCharAtSimple(2, "AN")
? o1.Content()
#--> bANnana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionReplaceCharsAtPositions(anPos, :With/:By = pcNewChar) -- replace the char at each listed position with pcNewChar.
1 exemples exécutéso1 = new stzString("AB3CD6EF9GH")
o1.ReplaceCharsAtPositions([ 3, 9, 6 ], Heart())
# all three replaced
? o1.Content()
#--> AB♥CD♥EF♥GHtest de la bibliothèqueQCSXTZZZIBWUReplaceCharsAtPositionsByMany(anPos, paChars): per-position parallel replacement -- position anPos[i] gets replaced by paChars[i] (cycling if there are more positions than chars).
1 exemples exécutéso1 = new stzString("ab3de6gh9")
o1.ReplaceCharsAtPositionsByMany([3, 6, 9], [ "c", "f", "i" ])
# the alphabet restored
? o1.Content()
#--> abcdefghitest de la bibliothèqueQCSXTZZZIBWUSit
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.aucune 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
(sans commentaire dans la source : le nom se lit comme une phrase) number of markers 1 exemples exécutésaussi écrite: NumberOfMarquersdans la section replace nth / first / lastexemple composé
o1 = new stzString("banana split")
? o1.NumberOfMarkers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) markers are sorted in ascending 1 exemples exécutésaussi écrite: MarkersAreSortedAscending · MarquersAreSortedInAscendingdans la 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
#--> 0test de la bibliothèqueaucune extension (sans commentaire dans la source : le nom se lit comme une phrase) markers are sorted in descending 1 exemples exécutésaussi écrite: MarquersAreSortedInDescendingdans la 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
#--> 0test de la bibliothèqueaucune extension (sans commentaire dans la source : le nom se lit comme une phrase) markers are sorted 2 exemples exécutésaussi écrite: MarquersAreSorteddans la section replace nth / first / lasto1 = new stzString("My name is #1, my age is #2, and my job is #3.")
# they are sorted
? o1.MarquersAreSorted()
# ... ascending
? o1.MarquersSortingOrder()
#--> 1
#--> ascendingtest de la bibliothèqueaucune extension MarkersAreUnsorted: TRUE when markers don't all monotone.
1 exemples exécutésaussi écrite: MarquersAreUnsortedo1 = 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
#--> unsortedtest de la bibliothèqueaucune extensionSpacifyChars / SpacifyCharsUsing / SpacifyCharsXT -- char-wise Spacify variants: insert a separator between every pair of consecutive chars (with optional step + direction).
3 exemples exécutéso1 = new stzString("99999999999")
o1.SpacifyChars()
# a space is inserted between every 9
? o1.Content()
#--> 9 9 9 9 9 9 9 9 9 9 9test de la bibliothèqueQCSXTZZZIBWUSpacify: shorter spelling -- same as SpacifyChars.
11 exemples exécutés# 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
#--> ^-------^---------^-------^------test de la bibliothèqueQCSXTZZZIBWUSpacifyUsing
SpacifyUsing: alias of SpacifyCharsUsing.QCSXTZZZIBWU
(sans commentaire dans la source : le nom se lit comme une phrase) spacify chars using 1 exemples exécutésdans la section replace nth / first / lasto1 = new stzString("SOFTANZA")
o1.SpacifyCharsUsing("~")
# tilde-joined
? o1.Content()
#--> S~O~F~T~A~N~Z~Atest de la bibliothèqueQCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) remove first 1 exemples exécutésdans la section remove first / lasto1 = new stzString("**A1****A2***A3")
o1.RemoveFirst("A")
# the first A is gone
? o1.Content()
#--> **1****A2***A3test de la bibliothèqueQCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) remove last 2 exemples exécutésdans la section remove first / lasto1 = new stzString("**A1****A2***A3")
o1.RemoveLast("A")
# the third A is gone
? o1.Content()
#--> **A1****A2***3test de la bibliothèqueQCSXTZZZIBWU Insert pcSubStr BEFORE position n -- or before the given anchor substring (mutating).
3 exemples exécutésaussi nommée: put before prepend at inject ahead ofo1 = new stzString("123456789")
o1.InsertBefore([4, 7], "_")
# underscores land before positions 4 and 7
? o1.Content()
#--> 123_456_789test de la bibliothèqueQCSXTZZZIBWUInsertBeforePosition
Same as InsertBefore: Insert pcSubStr BEFORE position n -- or before the given anchor substring (mutating).
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforePosition(2, "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionExtendToWith(n, pcChar): pad the string out to total length n by appending copies of pcChar at the end.
1 exemples exécutéso1 = new stzString("ABC")
o1.ExtendToWith(5, "*")
# 'ABC' padded to width 5 with '*'
? o1.Content()
#--> ABC**test de la bibliothèqueQCSXTZZZIBWUPad the string to total length n by cycling its own chars (mutating).
1 exemples exécutéso1 = new stzString("123")
o1.ExtendToWithCharsRepeated(8)
# '123' repeated up to width 8
? o1.Content()
#--> 12312312test de la bibliothèqueQCSXTZZZIBWUPad the string to total length n by cycling the given chars or range (mutating).
1 exemples exécutéso1 = new stzString("123")
o1.ExtendToWithCharsIn( 8, "1":"3" )
# it grows to length 8 by cycling 1,2,3
? o1.Content()
#--> 12312312test de la bibliothèqueQCSXTZZZIBWURemoveCharsWXT(pcCondition): remove every char where the predicate is TRUE. Predicate runs with @char bound.
6 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveCharsW("@char = 'a'")
? o1.Content()
#--> bnn splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveDuplicatedChars
RemoveDuplicatedChars: dedup chars in-place (keep first occurrence).
exemple composé
o1 = new stzString("banana split")
o1.RemoveDuplicatedChars()
? o1.Content()
#--> ban splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveDupChars
Same as RemoveDuplicatedChars: RemoveDuplicatedChars: dedup chars in-place (keep first occurrence).
exemple composé
o1 = new stzString("banana split")
o1.RemoveDupChars()
? o1.Content()
#--> ban splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertAt
Same as InsertBefore: Insert pcSubStr BEFORE position n -- or before the given anchor substring (mutating).
exemple composé
o1 = new stzString("banana split")
o1.InsertAt(2, "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsert pcSubStr AFTER position n -- or after the given anchor substring (mutating).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.InsertAfter(2, "an")
? o1.Content()
#--> baannana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertAfterPosition
Same as InsertAfter: Insert pcSubStr AFTER position n -- or after the given anchor substring (mutating).
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterPosition(2, "an")
? o1.Content()
#--> baannana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionInsertAfterPositions(anPos, pcStr): insert pcStr after each position in anPos. Walk descending so earlier positions stay valid as later inserts shift the string.
2 exemples exécutéso1 = new stzString("SOFTANZA")
o1.InsertAfterPositions([ 2, 4, 6, 8 ], " ")
# pairs, no trailing space
? o1.Content()
#--> SO FT AN ZAtest de la bibliothèqueQCSXTZZZIBWUInsertBeforePositions: mirror. Insert pcStr before EACH of the given positions (mutating).
1 exemples exécutéso1 = new stzString("SOFTANZA")
o1.InsertBeforePositions([ 2, 4, 6, 8 ], " ")
# split look
? o1.Content()
#--> S OF TA NZ Atest de la bibliothèqueQCSXTZZZIBWUInsertAfterEachNChars
InsertAfterEachNChars(n, pcStr) -- insert pcStr after every n characters, walking from start by default. :StartingFrom = :End walks from the right.
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterEachNChars(2, "an")
? o1.Content()
#--> baannaannaan sanplanitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUThe words of the string, as a list (whitespace-split by design).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.Words() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQQHow many words the string holds.
1 exemples exécutésaussi nommée: word count how many words count the wordsaussi écrite: CountWords · HowManyWordso1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9test de la bibliothèqueaucune extensionStemmedInLanguage
(sans commentaire dans la source : le nom se lit comme une phrase) stemmed in languagedans la section text-meaning domain (stztext, base/natural/)aucune extension
Stemmed
(sans commentaire dans la source : le nom se lit comme une phrase) stemmedaussi écrite: Stemdans la section text-meaning domain (stztext, base/natural/)aucune extension
StemmedWordsInLanguage
(sans commentaire dans la source : le nom se lit comme une phrase) stemmed words in languagedans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.StemmedWordsInLanguage("en") )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page aucune extension StemmedWords
(sans commentaire dans la source : le nom se lit comme une phrase) stemmed wordsaussi écrite: WordsStemmeddans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.StemmedWords() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) supported stemmer languages 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)aucune extension SupportedLemmaLanguages
(sans commentaire dans la source : le nom se lit comme une phrase) supported lemma languagesdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.SupportedLemmaLanguages() )
#--> [ "english", "french", "arabic" ]composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) synonyms 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)QCSXTZZZIBWUQQ (sans commentaire dans la source : le nom se lit comme une phrase) hypernyms 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.Hypernyms() )
#--> [ "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQQ (sans commentaire dans la source : le nom se lit comme une phrase) is synonym of 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.IsSynonymOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension HasSynonyms
(sans commentaire dans la source : le nom se lit comme une phrase) has synonymsdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.HasSynonyms()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension LemmatizedInLanguage
(sans commentaire dans la source : le nom se lit comme une phrase) lemmatized in languagedans la section text-meaning domain (stztext, base/natural/)aucune extension
Lemmatized
(sans commentaire dans la source : le nom se lit comme une phrase) lemmatizedaussi écrite: Lemmadans la section text-meaning domain (stztext, base/natural/)aucune extension
LemmatizedWordsInLanguage
(sans commentaire dans la source : le nom se lit comme une phrase) lemmatized words in languagedans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.LemmatizedWordsInLanguage("en") )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page aucune extension LemmatizedWords
(sans commentaire dans la source : le nom se lit comme une phrase) lemmatized wordsaussi écrite: WordsLemmatizeddans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.LemmatizedWords() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page aucune extension SentimentScore
(sans commentaire dans la source : le nom se lit comme une phrase) sentiment scoreaussi écrite: SentimentCompounddans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.SentimentScore()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) sentiment 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.Sentiment()
#--> neutralcomposé à partir de la signature, exécuté pour cette page aucune extension PositiveScore
(sans commentaire dans la source : le nom se lit comme une phrase) positive scoredans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.PositiveScore()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension NegativeScore
(sans commentaire dans la source : le nom se lit comme une phrase) negative scoredans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.NegativeScore()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension NeutralScore
(sans commentaire dans la source : le nom se lit comme une phrase) neutral scoredans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.NeutralScore()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extension IsPositive
(sans commentaire dans la source : le nom se lit comme une phrase) is positivedans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.IsPositive()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension IsNegative
(sans commentaire dans la source : le nom se lit comme une phrase) is negativedans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.IsNegative()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension POSTags
The part-of-speech tag of each word (via the text layer).
aussi écrite: PartOfSpeechTagsexemple composé
o1 = new stzString("banana split")
? @@( o1.POSTags() )
#--> [ "NN", "NN" ]composé à partir de la signature, exécuté pour cette page aucune extensionTaggedWords
(sans commentaire dans la source : le nom se lit comme une phrase) tagged wordsaussi écrite: WordsWithPOSdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.TaggedWords() )
#--> [ [ "banana", "NN" ], [ "split", "NN" ] ]composé à partir de la signature, exécuté pour cette page aucune extension NamedEntities
The named entities found in the string (via the text layer).aussi écrite: Entitiesaucune extension
EntitiesOfType
(sans commentaire dans la source : le nom se lit comme une phrase) entities of typedans la section text-meaning domain (stztext, base/natural/)aucune extension
PersonNames
(sans commentaire dans la source : le nom se lit comme une phrase) person namesdans la section text-meaning domain (stztext, base/natural/)aucune extension
Organizations
(sans commentaire dans la source : le nom se lit comme une phrase) organizationsdans la section text-meaning domain (stztext, base/natural/)aucune extension
Locations
(sans commentaire dans la source : le nom se lit comme une phrase) locationsdans la section text-meaning domain (stztext, base/natural/)aucune extension
ContentWords
(sans commentaire dans la source : le nom se lit comme une phrase) content wordsaussi écrite: Keywordsdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.ContentWords() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page aucune extension WithoutStopwords
(sans commentaire dans la source : le nom se lit comme une phrase) without stopwordsdans la section text-meaning domain (stztext, base/natural/)aucune extension
IsStopword
(sans commentaire dans la source : le nom se lit comme une phrase) is stopworddans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.IsStopword()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension ReadingEase
The Flesch reading-ease score of the string (via the text layer).aussi écrite: FleschReadingEaseaucune extension
ReadabilityGrade
(sans commentaire dans la source : le nom se lit comme une phrase) readability gradeaussi écrite: FleschKincaidGradedans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? o1.FleschKincaidGrade()
#--> 8.79composé à partir de la signature, exécuté pour cette page aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) key phrases 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.KeyPhrases(2) )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQQ (sans commentaire dans la source : le nom se lit comme une phrase) top key phrase 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)aucune extension (sans commentaire dans la source : le nom se lit comme une phrase) ranked keywords 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.RankedKeywords(2) )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQQ (sans commentaire dans la source : le nom se lit comme une phrase) summary sentences 1 exemples exécutésdans la section text-meaning domain (stztext, base/natural/)exemple composé
o1 = new stzString("banana split")
? @@( o1.SummarySentences(2) )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQQ (sans commentaire dans la source : le nom se lit comme une phrase) summarized in 1 exemples exécutésaussi écrite: Summarydans la section text-meaning domain (stztext, base/natural/)aucune 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.)
aussi écrite: SearchTokensexemple composé
o1 = new stzString("banana split")
? @@( o1.WordsForSearch() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page aucune extensionWordsThatAre
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
(sans commentaire dans la source : le nom se lit comme une phrase) nouns 1 exemples exécutésdans la section linguistic query . explain . exploreexemple composé
o1 = new stzString("banana split")
? @@( o1.Nouns() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU ProperNouns
(sans commentaire dans la source : le nom se lit comme une phrase) proper nounsdans la section linguistic query . explain . exploreaucune extension
(sans commentaire dans la source : le nom se lit comme une phrase) verbs 1 exemples exécutésdans la section linguistic query . explain . exploreQCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) adjectives 1 exemples exécutésdans la section linguistic query . explain . exploreQCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) adverbs 1 exemples exécutésdans la section linguistic query . explain . exploreaucune extension Pronouns
(sans commentaire dans la source : le nom se lit comme une phrase) pronounsdans la section linguistic query . explain . exploreaucune extension
SentencesThatAre
(sans commentaire dans la source : le nom se lit comme une phrase) sentences that aredans la section linguistic query . explain . exploreaucune extension
PositiveSentences
(sans commentaire dans la source : le nom se lit comme une phrase) positive sentencesdans la section linguistic query . explain . exploreaucune extension
NegativeSentences
(sans commentaire dans la source : le nom se lit comme une phrase) negative sentencesdans la section linguistic query . explain . exploreaucune extension
(sans commentaire dans la source : le nom se lit comme une phrase) most positive sentence 1 exemples exécutésdans la section linguistic query . explain . exploreaucune extension (sans commentaire dans la source : le nom se lit comme une phrase) most negative sentence 1 exemples exécutésdans la section linguistic query . explain . exploreaucune extension (sans commentaire dans la source : le nom se lit comme une phrase) most similar sentence to 1 exemples exécutésdans la section linguistic query . explain . exploreaucune extension (sans commentaire dans la source : le nom se lit comme une phrase) language 1 exemples exécutésaussi écrite: DetectedLanguagedans la section linguistic query . explain . exploreexemple composé
o1 = new stzString("banana split")
? o1.Language()
#--> unknowncomposé à partir de la signature, exécuté pour cette page aucune extension AutoLemmatized
(sans commentaire dans la source : le nom se lit comme une phrase) auto lemmatizeddans la section linguistic query . explain . exploreaucune extension
AutoStemmed
(sans commentaire dans la source : le nom se lit comme une phrase) auto stemmeddans la section linguistic query . explain . exploreaucune extension
SentimentExplained
(sans commentaire dans la source : le nom se lit comme une phrase) sentiment explaineddans la section linguistic query . explain . exploreaucune extension
ReadabilityExplained
(sans commentaire dans la source : le nom se lit comme une phrase) readability explaineddans la section linguistic query . explain . exploreaucune extension
Profile
(sans commentaire dans la source : le nom se lit comme une phrase) profiledans la section linguistic query . explain . exploreaucune extension
(sans commentaire dans la source : le nom se lit comme une phrase) lexical diversity 1 exemples exécutésaussi écrite: TypeTokenRatiodans la section linguistic query . explain . exploreo1 = 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" ]test de la bibliothèqueaucune extension StyleProfile
(sans commentaire dans la source : le nom se lit comme une phrase) style profiledans la section linguistic query . explain . exploreaucune extension
InContextWithWindow
(sans commentaire dans la source : le nom se lit comme une phrase) in context with windowdans la section linguistic query . explain . exploreaucune extension
InContext
(sans commentaire dans la source : le nom se lit comme une phrase) in contextaussi écrite: Concordancedans la section linguistic query . explain . exploreaucune extension
ComparedTo
(sans commentaire dans la source : le nom se lit comme une phrase) compared todans la section linguistic query . explain . exploreexemple composé
o1 = new stzString("banana split")
? @@( o1.ComparedTo("an") )
#--> [ [ "similarity", 0 ], [ "sentiment_delta", 0 ], [ "grade_delta", 12.19 ], [ "shared_keywords", [ ] ] ]composé à partir de la signature, exécuté pour cette page aucune extension ShowTagged
(sans commentaire dans la source : le nom se lit comme une phrase) show taggeddans la section linguistic query . explain . exploreaucune extension
ShowEntities
(sans commentaire dans la source : le nom se lit comme une phrase) show entitiesdans la section linguistic query . explain . exploreaucune extension
ShowSentiment
(sans commentaire dans la source : le nom se lit comme une phrase) show sentimentdans la section linguistic query . explain . exploreaucune extension
Split the string into a list of parts around a separator.
6 exemples exécutésaussi nommée: 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" ]test de la bibliothèqueQCSXTZZZIBWUSplitToNParts
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.
aussi écrite: SplitInNPartsexemple composé
o1 = new stzString("banana split")
? @@( o1.SplitToNParts(2) )
#--> [ "banana", " split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUA copy without leading and trailing whitespace; the original is unchanged.
2 exemples exécutésaussi nommée: without surrounding spaces whitespace stripped without padding cleanedo1 = new stzString(" lots of whitespace ")
# edges trimmed
? o1.Trimmed()
# then squeezed and shouted
? o1.SimplifyQ().Uppercased()
#--> lots of whitespace
#--> LOTS OF WHITESPACEtest de la bibliothèqueaucune extensionTrimmedLeft
A copy with the leading spaces removed; the original is unchanged.aucune extension
TrimmedRight
A copy with the trailing spaces removed; the original is unchanged.aucune extension
The lines of the string, as a list.
1 exemples exécutésaussi nommée: split into lines rows of text line by lineexemple composé
o1 = new stzString("banana split")
? @@( o1.Lines() )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQRTHow many lines the string holds.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.NumberOfLines()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a valid Unicode char NAME.
1 exemples exécutésaussi écrite: 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
#--> 1test de la bibliothèqueaucune extensionDotless / 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 exemples exécutésaussi écrite: 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!
#--> السلام عليكمtest de la bibliothèqueaucune extensionRemoveDiacritics
Remove the diacritics (accents) in place (mutating). For a copy, use DiacriticsRemoved.QCSXTZZZIBWU
TRUE if the string contains diacritics (accents).
1 exemples exécutésaussi écrite: HasDiacriticsexemple composé
o1 = new stzString("banana split")
? o1.ContainsDiacritics()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionDotsRemoved
The string in its dotless skeleton (rasm) -- the diacritic dots removed (Arabic-aware); the original is unchanged.
aussi écrite: Dotless · WithoutDots · DotsOnLettersRemoved · WithoutDotsOnLettersexemple composé
o1 = new stzString("banana split")
? o1.DotsRemoved()
#--> banana splıtcomposé à partir de la signature, exécuté pour cette page aucune extensionNLeftChars
The n leftmost chars, as a string (direction-aware).
aussi écrite: NLeftCharsAsStringexemple composé
o1 = new stzString("banana split")
? o1.NLeftChars(2)
#--> bacomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNRightChars
The n rightmost chars, as a string (direction-aware).
aussi écrite: NRightCharsAsStringexemple composé
o1 = new stzString("banana split")
? o1.NRightChars(2)
#--> itcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNFirstChars
The first n chars of the string.
exemple composé
o1 = new stzString("banana split")
? o1.NFirstChars(2)
#--> bacomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUThe last n chars of the string.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.NLastChars(2)
#--> itcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemove the chars at positions n1..n2 (mutating).
1 exemples exécutéso1 = new stzString("ABC456DE")
o1.RemoveSection(4, 6)
# the digits vanish
? o1.Content()
#--> ABCDEtest de la bibliothèqueQCSXTZZZIBWURemove the chars of each given [start, end] section (mutating).
2 exemples exécutéso1 = new stzString("1♥♥456♥♥901♥♥4")
o1.RemoveSections([ 2:3, 7:8, 12:13 ])
# the three heart pairs are gone
? o1.Content()
#--> 14569014test de la bibliothèqueaucune extensionReplaceSections
Replace each given [start, end] section with pcNewSubStr (mutating).aucune 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 exemples exécutéso1 = new stzString("123---78--")
o1.ReplaceSectionsByMany([ [1, 3], [7, 8] ], [ "*", "~" ])
# shrunk
? o1.Content()
#--> *---~--test de la bibliothèqueQCSXTZZZIBWURemove the leading spaces in place (mutating). For a copy, use TrimmedLeft.
2 exemples exécutésaussi nommée: strip leading spaces remove left whitespaceaucune extensionRemove the trailing spaces in place (mutating). For a copy, use TrimmedRight.
2 exemples exécutésaucune extensionTrimStart
Same as TrimLeft: Remove the leading spaces in place (mutating). For a copy, use TrimmedLeft.aucune extension
TrimEnd
Same as TrimRight: Remove the trailing spaces in place (mutating). For a copy, use TrimmedRight.aucune 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 exemples exécutéso1 = new stzString("12.58000")
o1.RemoveThisCharFromRightXT("0")
# the trailing zeros are gone
? o1.Content()
#--> 12.58test de la bibliothèqueQCSXTZZZIBWUReplaceLeadingChars(: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 exemples exécutésQCSXTZZZIBWUReplace the run of identical chars at the end of the string with the given string (mutating).
3 exemples exécutésQCSXTZZZIBWUSame 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 exemples exécutésQCSXTZZZIBWUReplaceLeadingChar(pcChar, :With = pcNew) -- replace the leading run only IF the leading char equals pcChar. Otherwise no-op.
3 exemples exécutésQCSXTZZZIBWUReplace the trailing run of pcChar with the given string (mutating).
2 exemples exécutésaucune extensionRemove leading and trailing whitespace in place (mutating). For a copy, use Trimmed.
1 exemples exécutéso1 = new stzString(" ♥♥♥123♥♥♥ ")
o1.Trim()
# only the spaces went
? o1.Content()
#--> ♥♥♥123♥♥♥test de la bibliothèqueQCSXTZZZIBWUContainsDuplicates
Same as ContainsDuplicatesCS: Same as ContainsDuplicatedSubStringsCS: TRUE if some substring occurs more than once in the string.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsDuplicates()
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsDuplicatedSubStrings
Same as ContainsDuplicatedSubStringsCS: TRUE if some substring occurs more than once in the string.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsDuplicatedSubStrings()
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUDuplicatedSubStrings
Same as DuplicatedSubStringsCS: The substrings that occur more than once in the string.
exemple composé
o1 = new stzString("banana split")
? @@( o1.DuplicatedSubStrings() )
#--> [ "a", "n" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNumberOfDuplicates
Same as NumberOfDuplicatesCS: How many duplicated occurrences the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfDuplicates()
#--> 4composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUHasDuplicatedChars
TRUE if some char occurs more than once.
exemple composé
o1 = new stzString("banana split")
? o1.HasDuplicatedChars()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionUpTo
For a single-char string: the chars from it UP TO the given char, as a list.aucune extension
DownTo
For a single-char string: the chars from it DOWN TO the given char, as a list.aucune 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).aucune 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.Boxed()
#--> ┌──────────────┐
#--> │ banana split │
#--> └──────────────┘composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUBoxedRound
A rounded-corner boxed copy of the string.
aussi écrite: BoxedDashed · BoxedRoundedexemple composé
o1 = new stzString("banana split")
? o1.BoxedRound()
#--> ╭──────────────╮
#--> │ banana split │
#--> ╰──────────────╯composé à partir de la signature, exécuté pour cette page aucune extensionBoxedRoundedDashed
A rounded, dashed-line boxed copy of the string.
aussi écrite: BoxedRoundDashedexemple composé
o1 = new stzString("banana split")
? o1.BoxedRoundedDashed()
#--> ╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
#--> ┊ banana split ┊
#--> ╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯composé à partir de la signature, exécuté pour cette page aucune extensionEachCharBoxed
Each char in its own box cell, as a string.
aussi écrite: EachCharBoxed_aliasexemple composé
o1 = new stzString("banana split")
? o1.EachCharBoxed()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ b │ a │ n │ a │ n │ a │ │ s │ p │ l │ i │ t │
#--> └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUBoxRoundEachChar
BoxRoundEachChar: surround each char with a rounded-corner box.QCSXTZZZIBWU
SplitAroundPosition
SplitAroundPosition(n): two pieces around codepoint position n.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAroundPosition(2) )
#--> [ "b", "nana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionTheseCharsZ
TheseCharsZ([chars]): each char grouped with ALL its positions -- [ [c, [positions]], ... ].
exemple composé
o1 = new stzString("banana split")
? @@( o1.TheseCharsZ([ "an", "a" ]) )
#--> [ [ "an", [ 2, 4 ] ], [ "a", [ 2, 4, 6 ] ] ]composé à partir de la signature, exécuté pour cette page aucune extensionAlignXT
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.UniqueChars() )
#--> [ "b", "a", "n", " ", "s", "p", "l", "i", "t" ]composé à partir de la signature, exécuté pour cette page aucune extensionThe codepoint of a single-char string -- or the codepoints list for a longer one.
1 exemples exécutés# 'I' is codepoint 73
? Q("I").Unicode()
#--> 73test de la bibliothèqueaucune extensionCharName / 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 exemples exécutésaussi écrite: UnicodeName · CharacterNameaucune extensionUnicodes
The codepoint of each char, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Unicodes() )
#--> [ 98, 97, 110, 97, 110, 97, 32, 115, 112, 108, 105, 116 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUCharsAndUnicodes
Each char paired with its codepoint: [ [char, unicode], ... ].
aussi écrite: UnicodePerCharexemple composé
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 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUUniqueCharsAndUnicodes
Same as CharsAndUnicodesU: The unique chars paired with their codepoints.
exemple composé
o1 = new stzString("banana split")
? @@( o1.UniqueCharsAndUnicodes() )
#--> [ [ "b", 98 ], [ "a", 97 ], [ "n", 110 ], [ " ", 32 ], [ "s", 115 ], [ "p", 112 ], [ "l", 108 ], [ "i", 105 ], [ "t", 116 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionThe string repeated n times.
1 exemples exécutésaussi nommée: repeat duplicate times concatenate copies tile duplicate repeat n times multiply the string echoaussi écrite: RepeatedNTimesexemple composé
o1 = new stzString("banana split")
? o1.Repeated(2)
#--> banana splitbanana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionRepeat
Turn the content into itself repeated n times (mutating). For a copy, use Repeated.
exemple composé
o1 = new stzString("banana split")
o1.Repeat(2)
? o1.Content()
#--> banana splitbanana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUConcatenate
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.
aussi nommée: add to the end concatenate tack on put after join toexemple composé
o1 = new stzString("banana split")
o1.Append("an")
? o1.Content()
#--> banana splitancomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUConcatenated
The string with pcStr appended, as data; the original is unchanged.
exemple composé
o1 = new stzString("banana split")
? o1.Concatenated("an")
#--> banana splitancomposé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the content equals the given string (case-sensitive).
6 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsEqualTo("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsStrictlyEqualTo
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.
exemple composé
o1 = new stzString("banana split")
? o1.IsStrictlyEqualTo(3)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRemoveFirstCharCS(pCaseSensitive): "permissiveness" form -- accepts the case-sensitivity flag for narrative-symmetry, but ignores it (per stzStringTest block #37). (case-sensitive by default)
2 exemples exécutéso1 = new stzString("1BATISTA")
o1.RemoveFirstChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("1BATISTA").FirstCharRemoved()
#--> BATISTA
#--> BATISTAtest de la bibliothèqueQCSXTZZZIBWURemoveLeadingChars
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.
exemple composé
o1 = new stzString("banana split")
o1.RemoveLeadingChars()
? o1.Content()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWULeadingCharsAsString
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 "---".aussi écrite: LeadingSubString · LeadingCharsAsSubStringQCSXTZZZIBWU
The run of identical chars at the START of the string, as a list of chars.
1 exemples exécutésQCSXTZZZIBWUThe leading char (case-dial form). (case-sensitive by default)
1 exemples exécutéso1 = new stzString("000122.12")
# the leading char
? o1.LeadingChar()
o1.RemoveThisLeadingChar("0")
# the run is gone
? o1.Content()
#--> 0
#--> 122.12test de la bibliothèqueQCSXTZZZIBWUNumberOfLeadingChars
Same as NumberOfLeadingItems: How long the leading char run is. (case-sensitive by default)
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLeadingChars()
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUTrailingCharsAsString
The run of identical chars at the end of the string, as a string.aussi écrite: 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 exemples exécutésQCSXTZZZIBWUNumberOfTrailingChars
Same as NumberOfTrailingItems: How long the trailing char run is. (case-sensitive by default)
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfTrailingChars()
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveLeadingChar
Singular forms: RemoveLeadingChar = remove ONE leading char, RemoveAnyLeadingChar = peel every leading char of the same type.
exemple composé
o1 = new stzString("banana split")
o1.RemoveLeadingChar()
? o1.Content()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveAnyLeadingChar
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.
exemple composé
o1 = new stzString("banana split")
o1.RemoveAnyLeadingChar()
? o1.Content()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionRemoveTrailingChar
Drop the LAST char of the string (one char, from the end) -- mutating.
exemple composé
o1 = new stzString("banana split")
o1.RemoveTrailingChar()
? o1.Content()
#--> banana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveTrailingChars
Drop the whole trailing run of the string's last char (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveTrailingChars()
? o1.Content()
#--> banana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveBoundingChars
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.
exemple composé
o1 = new stzString("banana split")
o1.RemoveBoundingChars()
? o1.Content()
#--> anana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUImmutable / past-tense forms: return the modified content without mutating This. Used by stzNumber.Absolute() and similar fluent chains.
1 exemples exécutéso1 = new stzString("1BATISTA")
o1.RemoveFirstChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("1BATISTA").FirstCharRemoved()
#--> BATISTA
#--> BATISTAtest de la bibliothèqueaucune extensionA copy with the last char removed; the original is unchanged.
1 exemples exécutéso1 = new stzString("BATISTA1")
o1.RemoveLastChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA1").LastCharRemoved()
#--> BATISTA
#--> BATISTAtest de la bibliothèqueaucune extensionRemove the last char of the string (mutating).
1 exemples exécutéso1 = new stzString("BATISTA1")
o1.RemoveLastChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA1").LastCharRemoved()
#--> BATISTA
#--> BATISTAtest de la bibliothèqueQCSXTZZZIBWUSame 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 exemples exécutés# 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]}Utest de la bibliothèqueQCSXTZZZIBWUConditional 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 exemples exécutéso1 = new stzString("{abc}")
o1.RemoveThisFirstChar("{")
o1.RemoveThisLastChar("}")
# both braces gone
? o1.Content()
#--> abctest de la bibliothèqueQCSXTZZZIBWURemove the last char when it equals pcChar (mutating).
1 exemples exécutéso1 = new stzString("{abc}")
o1.RemoveThisFirstChar("{")
o1.RemoveThisLastChar("}")
# both braces gone
? o1.Content()
#--> abctest de la bibliothèqueQCSXTZZZIBWUThe raw bytes of the string, as a list.
1 exemples exécutéso1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]test de la bibliothèqueaucune extensionBytesPerChar
The bytes of each char, char by char.
exemple composé
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" ] ] ]composé à partir de la signature, exécuté pour cette page aucune extensionHow many bytes each char occupies (UTF-8), as a list.
1 exemples exécutéso1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]test de la bibliothèqueaucune extensionThe size of the string in bytes (UTF-8).
1 exemples exécutéso1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]test de la bibliothèqueaucune extensionBytecodes
The numeric byte codes of the string, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Bytecodes() )
#--> [ 98, 97, 110, 97, 110, 97, 32, 115, 112, 108, 105, 116 ]composé à partir de la signature, exécuté pour cette page aucune extensionBytecodesPerChar
The byte codes of each char, char by char.
exemple composé
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 ] ] ]composé à partir de la signature, exécuté pour cette page aucune extensionSizeInBytesPerChar
How many bytes each char occupies (UTF-8), as a list.
exemple composé
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 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionThe size of the string in bytes (UTF-8).
3 exemples exécutéso1 = new stzString("s㊱m")
? o1.NumberOfBytes()
? o1.SizeInBytes()
? @@(o1.Bytes())
? @@(o1.NumberOfBytesPerChar())
#--> 5
#--> 5
#--> [ "s", "�", "�", "�", "m" ]
#--> [ [ "s", 1 ], [ "㊱", 3 ], [ "m", 1 ] ]test de la bibliothèqueaucune extensionSame as ContainsOneOfTheseCS: TRUE if the string contains at least ONE of the given substrings.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsOneOfThese([ "an", "a" ])
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsEither(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 exemples exécutés# 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
#--> 1test de la bibliothèqueaucune extensionSame as FindTheseBoundsCS: Find the given opening and closing bounds: their positions in the string.
1 exemples exécutés# 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 ]test de la bibliothèqueQCSXTZZZIBWURemove the given opening and closing bounds when they enclose the string (mutating).
2 exemples exécutéso1 = new stzString("<<word>>")
# it is angle-bounded
? o1.IsBoundedBy(["<<", ">>"])
o1.RemoveTheseBounds("<<",">>")
# stripped
? o1.Content()
#--> 1
#--> wordtest de la bibliothèqueQCSXTZZZIBWUSingle-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 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveBounds()
? o1.Content()
#--> anana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveThisBound
RemoveThisBound(c): remove a specific same-char bound from both ends.
exemple composé
o1 = new stzString("banana split")
o1.RemoveThisBound("an")
? o1.Content()
#--> ba splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.Between(TRUE, TRUE)
#--> bacomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame 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 exemples exécutésaussi écrite: SubStringsBoundedBy · AnySubStringsBoundedByo1 = new stzString("blabla bla <<word1>> bla bla <<word2>>")
? o1.SubstringsBoundedBy([ "<<", ">>" ])
#--> word1
#--> word2test de la bibliothèqueQCSXTZZZIBWUAnyBoundedBy
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)
aussi écrite: ContainsBoundedBy · ContainsAnyBoundedByexemple composé
o1 = new stzString("banana split")
? o1.ContainsSubStringsBoundedBy([ "an", "a" ])
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFirstBetween
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).
exemple composé
o1 = new stzString("banana split")
o1.ReplaceBetween("an", "an", "AN")
? o1.Content()
#--> banANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceFirstBetween
Replace what lies between the FIRST pcOpen...pcClose pair (the bounds stay) -- engine-backed, mutating.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceFirstBetween("an", "an", "AN")
? o1.Content()
#--> banANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceLastBetween
Replace what lies between the LAST pcOpen...pcClose pair (the bounds stay) -- mutating.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceLastBetween("an", "an", "AN")
? o1.Content()
#--> banANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceNthBetween
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 exemples exécutéso1 = new stzString("__/♥\__")
o1.RemoveBetween("/", "\")
# the heart between / and \\ is gone, bounds kept
? o1.Content()
#--> __/\__test de la bibliothèqueQCSXTZZZIBWURemoveFirstBetween
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
ContainsThese
contains these
aussi écrite: ContainsAllOfTheseexemple composé
o1 = new stzString("banana split")
? o1.ContainsThese([ "an", "a" ])
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as FindAsSectionsCS: The [start, end] section of every occurrence of pcSubStr.
2 exemples exécutésaussi écrite: FindAllAsSectionso1 = new stzString(' str = " ... " and str != " *** " ')
? @@NL( o1.BoundedBy('"') ) + NL
? @@( o1.FindAsSections( o1.BoundedBy('"') ) )
#--> [ " ... ", " and str != ", " *** " ]
#--> [ [ 11, 17 ], [ 19, 39 ], [ 41, 46 ] ]test de la bibliothèqueQCSXTZZZIBWUDFindAsSection
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".
aussi écrite: FindFirstAsSectionexemple composé
o1 = new stzString("banana split")
? @@( o1.FindAsSection("an") )
#--> [ 2, 3 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSTSame 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 exemples exécutéso1 = 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 ] ]test de la bibliothèqueQCSXTZZZIBWUMultiReplaced
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.
aussi écrite: TheseReplaced · SubStringsReplaced · ManySubstringsReplaced · TheseSubstringsReplacedexemple composé
o1 = new stzString("banana split")
? o1.ManyReplaced([ "an", "a" ], "AN")
#--> bANANAN splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveNth
Same as RemoveNthCS: Remove only the nth occurrence of pcSubStr (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveNth(2, "an")
? o1.Content()
#--> bana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSurround
Put pcBefore and pcAfter around the content (mutating). For a copy, use Surrounded.aussi nommée: wrap enclose put around bracket withQCSXTZZZIBWU
Surrounded
The content with pcBefore and pcAfter around it, as data.
exemple composé
o1 = new stzString("banana split")
? o1.Surrounded("an", "an")
#--> anbanana splitancomposé à partir de la signature, exécuté pour cette page aucune extensionDuplicates(): 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.Duplicates() )
#--> [ "a", "an", "n", "na" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsPalindrome
Same as IsPalindromeCS: TRUE if the string reads the same backward (a palindrome).
exemple composé
o1 = new stzString("banana split")
? o1.IsPalindrome()
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsPalindromeWords
TRUE if the WORD sequence reads the same backward.
exemple composé
o1 = new stzString("banana split")
? o1.IsPalindromeWords()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSame as IsAnagramOfCS: TRUE if the string is an anagram of the given one (same chars, reordered).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsAnagramOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUTRUE if the string is in UPPER CASE.
1 exemples exécutésaussi nommée: all caps in capitals all uppercase is it shouting# happy-holidays is lowercase
? StzStringQ("happy-holidays").IsLowercase()
# HOLIDAYS! is uppercase
? StzStringQ("HOLIDAYS!").IsUppercase()
#--> 1
#--> 1test de la bibliothèqueaucune extensionTRUE if the string is in lower case.
4 exemples exécutésaussi nommée: all lowercase all small letters in lower case? Q("bread").IsLowercase()
#--> 1test de la bibliothèqueaucune extensionIsCapitalcase
IsCapitalcase(): TRUE iff the string already equals its TITLE-cased form (every word capitalised), per the original.
exemple composé
o1 = new stzString("banana split")
? o1.IsCapitalcase()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsHybridcase
TRUE if the string mixes upper and lower case.
exemple composé
o1 = new stzString("banana split")
? o1.IsHybridcase()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsTitlecase
TRUE if the string is written in Title Case.
exemple composé
o1 = new stzString("banana split")
? o1.IsTitlecase()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCamelCase
TRUE if the string is written in camelCase.
exemple composé
o1 = new stzString("banana split")
? o1.IsCamelCase()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsSnakeCase
TRUE if the string is written in snake_case.
exemple composé
o1 = new stzString("banana split")
? o1.IsSnakeCase()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsKebabCase
TRUE if the string is written in kebab-case.
exemple composé
o1 = new stzString("banana split")
? o1.IsKebabCase()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsOnlySpaces
TRUE if the string is made of spaces only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlySpaces()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsOnlyLetters
TRUE if the string is made of letters only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyLetters()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsOnlyNumbers
TRUE if the string is made of number chars only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyNumbers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsOnlyDigits
TRUE if the string is made of digits only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyDigits()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsOnlyLettersAndNumbers
TRUE if the string is made of letters and numbers only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyLettersAndNumbers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSame as IsMadeOfCS: TRUE if the string is built ONLY from the given substring(s).
6 exemples exécutés# made of m, a, a, n
? Q("maan").IsMadeOf([ "m", "a", "a", "n" ])
#--> 1test de la bibliothèqueQCSXTZZZIBWUIsMadeOfChar
Same as IsMadeOfCharCS: TRUE if the string is made of the given char only.
exemple composé
o1 = new stzString("banana split")
? o1.IsMadeOfChar("a")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as IsMadeOfSomeCS: TRUE if the string is made only of (some of) the given substrings.
4 exemples exécutés# all chars are hex digits
? Q("4E992").IsMadeOfSome( HexChars() )
#--> 1test de la bibliothèqueQCSXTZZZIBWUIsCountryName
TRUE if the string names a country (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryName()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCountryAbbreviation
TRUE if the string is a country abbreviation (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryAbbreviation()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCountryNumber
TRUE if the string is a numeric country code (per the locale data).
aussi écrite: IsCountryCodeexemple composé
o1 = new stzString("banana split")
? o1.IsCountryNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCountryPhoneCode
TRUE if the string is a country phone code.
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryPhoneCode()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsLanguageName
TRUE if the string names a language (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsLanguageName()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsLanguageNumber
TRUE if the string is a numeric language code.
aussi écrite: IsLanguageCodeexemple composé
o1 = new stzString("banana split")
? o1.IsLanguageNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a language abbreviation.
2 exemples exécutés? StzStringQ("ar").IsLanguageAbbreviation()
? IsLanguageAbbreviation("ar")
#--> 1
#--> 1test de la bibliothèqueaucune extensionTRUE if the string has an ISO locale shape (like en-US).
2 exemples exécutéso1 = new stzString("ar_Arab_TN")
# well formed
? o1.IsLocaleAbbreviation()
#--> 1test de la bibliothèqueaucune extensionIsCurrencyName
TRUE if the string names a currency (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCurrencyName()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCurrencySymbol
Currency-symbol check (stub: the monolith left it TODO; completes with the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCurrencySymbol()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string names a script (per the locale data).
2 exemples exécutésaussi écrite: IsScript# yes
? StzStringQ("latin").IsScriptName()
#--> 1test de la bibliothèqueaucune extensionTRUE if the string is a script code.
1 exemples exécutésaussi écrite: IsScriptNumberexemple composé
o1 = new stzString("banana split")
? o1.IsScriptCode()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a script abbreviation.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsScriptAbbreviation()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsOneOccurrence
Same as ContainsOneOccurrenceCS: TRUE if the substring occurs EXACTLY once.
aussi écrite: ContainsOne · ContainsOnlyOneexemple composé
o1 = new stzString("banana split")
? o1.ContainsOneOccurrence("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as ContainsNTimesCS: TRUE if the substring occurs exactly n times.
2 exemples exécutés? Q("ar_arab_tn").ContainsNTimes(2,"_")
#--> 1test de la bibliothèqueQCSXTZZZIBWURepresentsInteger
TRUE if the string is an integer literal.
aussi écrite: RepresentsCalculableIntegerexemple composé
o1 = new stzString("banana split")
? o1.RepresentsInteger()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRepresentsSignedInteger
TRUE if the string is a SIGNED integer literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsSignedInteger()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRepresentsUnsignedInteger
TRUE if the string is an UNSIGNED integer literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsUnsignedInteger()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a real-number literal (carries a fractional dot).
2 exemples exécutésaussi écrite: IsRealInString · IsARealInString · RepresentsRealInString · RepresentsCalculableRealNumber# yes
? Q("12500543.12").RepresentsRealNumber()
#--> 1test de la bibliothèqueaucune extensionRepresentsSignedNumber
TRUE if the string is a SIGNED number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsSignedNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRepresentsUnsignedNumber
TRUE if the string is an UNSIGNED number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsUnsignedNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string holds a numeric literal.
3 exemples exécutés# IsNumberInString on a space
? Q(" ").IsNumberInString()
#--> 0test de la bibliothèqueaucune extensionTRUE if the string holds a list literal (normal or computable form).
3 exemples exécutés# a bracketed list
? StzStringQ("[ 2, 3, 5:7 ]").IsListInString()
# a char range
? StzStringQ("'A':'F'").IsListInString()
#--> 1
#--> 1test de la bibliothèqueaucune extensionFilledWith
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.
exemple composé
o1 = new stzString("banana split")
? o1.FilledWith("a")
#--> acomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUToList
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.ToList() )
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUTRUE if the string is a valid number literal (any base form).
2 exemples exécutésaussi écrite: RepresentsCalculableNumberexemple composé
o1 = new stzString("banana split")
? o1.RepresentsNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a decimal number literal.
1 exemples exécutésaussi écrite: RepresentsNumberInDecimalFormexemple composé
o1 = new stzString("banana split")
? o1.RepresentsDecimalNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a binary number literal.
2 exemples exécutésaussi écrite: RepresentsNumberInBinaryForm# plain
? Q("0b110001.1001").RepresentsNumberInBinaryForm()
# signed before the prefix
? Q("-0b110001.1001").RepresentsNumberInBinaryForm()
# sign inside: malformed
? Q("0b-110001.1001").RepresentsNumberInBinaryForm()
#--> 1
#--> 1
#--> 0test de la bibliothèqueaucune extensionTRUE if the string is a hexadecimal number literal.
2 exemples exécutésaussi écrite: RepresentsNumberInHexForm# hex form
? Q("x4E992").RepresentsNumberInHexForm()
#--> 1test de la bibliothèqueaucune extensionTRUE if the string is an octal number literal.
2 exemples exécutésaussi écrite: RepresentsNumberInOctalForm# octal form
? Q("o01234567").RepresentsNumberInOctalForm()
#--> 1test de la bibliothèqueaucune extensionIsBlank
TRUE if the string is empty or whitespace only.
exemple composé
o1 = new stzString("banana split")
? o1.IsBlank()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsIdentifier
TRUE if the string is a valid identifier (letter or underscore first, then letters, digits, underscores).
exemple composé
o1 = new stzString("banana split")
? o1.IsIdentifier()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsBalanced
TRUE if the brackets and parentheses in the string are balanced.
exemple composé
o1 = new stzString("banana split")
? o1.IsBalanced()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionIsNestedUsing
Different from IsBalanced (which only checks balance of opens and closes) -- this answers whether the structure has any proper nesting depth >= 2.
exemple composé
o1 = new stzString("banana split")
? o1.IsNestedUsing("an", "an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionIsNested
TRUE if the string's bounds nest (bounded regions inside bounded regions).
exemple composé
o1 = new stzString("banana split")
? o1.IsNested()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsEmailLike
TRUE if the string looks like an email address.
exemple composé
o1 = new stzString("banana split")
? o1.IsEmailLike()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsUrlLike
TRUE if the string looks like a URL.aucune extension
IsPangram
TRUE if the string uses every letter of the alphabet (a pangram).
exemple composé
o1 = new stzString("banana split")
? o1.IsPangram()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsIsogram
TRUE if no char repeats in the string (an isogram).
exemple composé
o1 = new stzString("banana split")
? o1.IsIsogram()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsWord
TRUE if the string is a single word.
exemple composé
o1 = new stzString("banana split")
? o1.IsWord()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a single letter.
2 exemples exécutés# * is not a letter, computationally
? NOT Q("*").IsLetter()
# ... and linguistically
? Q("*").IsNotLetter()
#--> 1
#--> 1test de la bibliothèqueaucune extensionIsADigit
TRUE if the string is a single digit.
exemple composé
o1 = new stzString("banana split")
? o1.IsDigit()
#--> 0composé à partir de la signature, exécuté pour cette page · écrit IsADigit() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsDigit(), et Haro supprime le détour aucune extensionTRUE if the string starts with a repeated char run.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HasLeadingChars()
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUTRUE if the string ends with a repeated char run.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HasTrailingChars()
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUHasLeadingAndTrailingChars
TRUE if the string both starts AND ends with repeated char runs.
exemple composé
o1 = new stzString("banana split")
? o1.HasLeadingAndTrailingChars()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsReversedCopyOf
Same as IsReversedCopyOfCS: TRUE if the string is the reverse of the given one.
exemple composé
o1 = new stzString("banana split")
? o1.IsReversedCopyOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsLatin
TRUE if the string contains Latin chars.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsLatin()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionContainsArabic
TRUE if the string contains Arabic chars.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsArabic()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsChar
Same as ContainsCharCS: TRUE if the string contains the given char.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsChar("an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsAnyOfChars
Same as ContainsAnyOfCharsCS: contains char / any / all
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAnyOfChars("an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsAllOfChars
Same as ContainsAllOfCharsCS: contains char / any / all
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAllOfChars("an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsOnlyChars
Same as ContainsOnlyCharsCS: contains char / any / all
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyChars("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindInvisibleChars
The positions of the invisible chars.aucune extension
InvisibleChars
The invisible chars of the string, as a list.aucune extension
ContainsInvisibleChars
TRUE if the string contains invisible chars.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsInvisibleChars()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionIsControl
TRUE if the string is made of control chars.
exemple composé
o1 = new stzString("banana split")
? o1.IsControl()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHasMark
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.HasMark()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionCharIsControlAt
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.CharIsControlAt(2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionCharIsMarkAt
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.CharIsMarkAt(2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionCharIsSpaceAt
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.CharIsSpaceAt(2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionOnlyMarks
only marks / controlsaucune extension
OnlyControls
only marks / controlsaucune extension
OnlyLatinLetters
only marks / controls
exemple composé
o1 = new stzString("banana split")
? o1.OnlyLatinLetters()
#--> bananasplitcomposé à partir de la signature, exécuté pour cette page aucune extensionIsNumericString
TRUE if the string is numeric.
aussi écrite: IsANumberexemple composé
o1 = new stzString("banana split")
? o1.IsNumericString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsAlphaString
numeric / alpha checks
aussi écrite: IsAllLettersexemple composé
o1 = new stzString("banana split")
? o1.IsAlphaString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionMatchesRegex
TRUE if the string matches the given regex pattern.
aussi écrite: IsMatchedByRegexexemple composé
o1 = new stzString("banana split")
? o1.MatchesRegex("an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUENGINE-BACKED (StzEngineStringSubStrings): all substrings in (i,j) order, no dedup. Retires the O(n^2) Haro double-loop.
5 exemples exécutésaussi écrite: Substrinks · Substrongso1 = new stzString("RINGORIALAND")
# there are 12*13/2 = 78 substrings
? o1.NumberOfSubStrings()
# SubStrings() returns that many
? len( o1.SubStrings() )
#--> 78
#--> 78test de la bibliothèqueQCSXTZZZIBWUWFHow many substrings the string yields.
4 exemples exécutésaussi écrite: HowManySubStringso1 = new stzString("..ONE..TWO..ONE..")
# all substrings
? o1.NumberOfSubStrings()
# unique substrings
? o1.NumberOfUniqueSubStrings()
#--> 153
#--> 120test de la bibliothèqueQCSXTZZZIBWUUniqueSubStrings
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.aucune extension
How many DISTINCT substrings the string yields.
1 exemples exécutéso1 = new stzString("..ONE..TWO..ONE..")
# all substrings
? o1.NumberOfSubStrings()
# unique substrings
? o1.NumberOfUniqueSubStrings()
#--> 153
#--> 120test de la bibliothèqueaucune extensionIndexOf
(sans commentaire dans la source : le nom se lit comme une phrase) index ofdans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? o1.IndexOf("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU FindAllChar
(sans commentaire dans la source : le nom se lit comme une phrase) find all chardans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAllChar("an") )
#--> [ 2, 4, 6 ]composé à partir de la signature, exécuté pour cette page aucune extension StartsWithAny
Same as StartsWithAnyCS: TRUE if the string starts with ANY of the given prefixes.
exemple composé
o1 = new stzString("banana split")
? o1.StartsWithAny("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUEndsWithAny
(sans commentaire dans la source : le nom se lit comme une phrase) ends with anydans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? o1.EndsWithAny("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU FindBetweenAsSection
(sans commentaire dans la source : le nom se lit comme une phrase) find between as sectiondans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? @@( o1.FindBetweenAsSection("an", "an") )
#--> [ 3, 4 ]composé à partir de la signature, exécuté pour cette 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.aucune extension
FindBoundedByAsSections
Same as FindBoundedByAsSectionsCS: The [start, end] sections of the substrings bounded by the given bounds.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindBoundedByAsSections([ "an", "a" ]) )
#--> [ [ 4, 3 ], [ 6, 5 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindAnyBoundedByAsSections
The [start, end] sections of the substrings bounded by any of the given bounds.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedByAsSections([ "an", "a" ]) )
#--> [ [ 4, 3 ], [ 6, 5 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindAnyBoundedBy
FindAnyBoundedBy(pacBounds): single-arg form. Accepts a list [open, close] or a single string used for both ends.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedBy([ "an", "a" ]) )
#--> [ 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindAnyBoundedByIBAsSections
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedByIBAsSections([ "an", "a" ]) )
#--> [ [ 2, 4 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionDeepFindBoundedByZZ
The [start, end] sections of the bounded substrings at EVERY nesting depth.
aussi écrite: DeepFindSubStringsZZ · DeepFindSubStringsBoundedByZZexemple composé
o1 = new stzString("banana split")
? @@( o1.DeepFindBoundedByZZ([ "an", "a" ]) )
#--> [ [ 6, 5 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionDeepBoundedBy
The bounded substrings at every nesting depth.QCSXTZZZIBWU
DeepSubStringsZZ
The nested bounded substrings with their [start, end] sections.
aussi écrite: DeepSubStringsBoundedByZZexemple composé
o1 = new stzString("banana split")
? @@( o1.DeepSubStringsZZ([ "an", "a" ]) )
#--> [ [ "", [ 6, 5 ] ] ]composé à partir de la signature, exécuté pour cette page aucune extensionDeepFindBoundedByIBZZ
The nested bounded sections, bounds INCLUDED (IB).
aussi écrite: DeepFindSubStringsBoundedByIBZZexemple composé
o1 = new stzString("banana split")
? @@( o1.DeepFindBoundedByIBZZ([ "an", "a" ]) )
#--> [ [ 4, 6 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionDeepSubStringsBoundedByIBZZ
The nested bounded substrings, bounds included, with their sections.
exemple composé
o1 = new stzString("banana split")
? @@( o1.DeepSubStringsBoundedByIBZZ([ "an", "a" ]) )
#--> [ [ "ana", [ 4, 6 ] ] ]composé à partir de la signature, exécuté pour cette page aucune extensionNestedSubStrings
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 exemples exécutés# 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 ] ]test de la bibliothèqueQCSXTZZZIBWUFThe positions of the substrings satisfying the W condition.
1 exemples exécutés# 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 ] ]test de la bibliothèqueQCSXTZZZIBWUFFindSubStringsMadeOf
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.
aussi écrite: FindMadeOfexemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringsMadeOf("an") )
#--> [ 2 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindNthOccurrenceCS / FindNthOccurrence: n-th match of pcSub inside the content. Engine-backed. (case-sensitive by default)
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindNthOccurrence(2, "an")
#--> 4composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUAllPositionsOf
All positions of pcSub (collect-them-all helper).
aussi écrite: FindMarker · FindMarquer · OccurrencesOfMarquerexemple composé
o1 = new stzString("banana split")
? @@( o1.AllPositionsOf("an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionFindFirstNOccurrences
FindFirstNOccurrences(n, pcSub): the first n positions where pcSub appears in the content.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindFirstNOccurrences(2, "an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionFindLastNOccurrences
FindLastNOccurrences(n, pcSub): the last n positions.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindLastNOccurrences(2, "an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionHowMany family: count occurrences of pcSub in the content.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HowMany("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSTHow long the trailing char run is.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HowManyTrailingChar()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHowManyLeadingChar
How long the leading char run is.
exemple composé
o1 = new stzString("banana split")
? o1.HowManyLeadingChar()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHowManyOccurrenceOfCharRightSide
HowManyOccurrenceOfCharRightSide(pcChar) / EndSide: count the trailing run of pcChar.
aussi écrite: HowManyOccurrenceOfCharEndSide · NumberOfOccurrenceOfCharEndSide · NumberOfOccurrenceOfCharRightSide · NumberOfOccurrenceOfCharEndingSideexemple composé
o1 = new stzString("banana split")
? o1.HowManyOccurrenceOfCharRightSide("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHowManyOccurrenceOfCharLeftSide
How many times the char repeats at the START of the string.
aussi écrite: HowManyOccurrenceOfCharStartSide · NumberOfOccurrenceOfCharLeftSide · NumberOfOccurrenceOfCharStartSide · NumberOfOccurrenceOfCharStartingSideexemple composé
o1 = new stzString("banana split")
? o1.HowManyOccurrenceOfCharLeftSide("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSubStringsMadeOf
SubStringsMadeOf(pcChar): the actual matching substrings (each maximal run as a single string).
exemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringsMadeOf("an") )
#--> [ "anana" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindSubStringBoundsUpToNCharsAsSections
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.
aussi écrite: FindSubStringBoundsUpToNCharsexemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringBoundsUpToNCharsAsSections("an", 2) )
#--> [ [ 1, 1 ], [ 4, 5 ], [ 2, 3 ], [ 6, 7 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionFindSubStringsBoundedBy(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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringsBoundedBy([ "an", "a" ]) )
#--> [ 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindSubStringsBetween
Find the substrings lying between the two given bounds.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringsBetween("an", "an") )
#--> [ 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindSubStringBoundedBy
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)aucune 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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindBoundedSubString("an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindBoundedSubStrings
Find the bounded substrings (polymorphic: one substring or an [open, close] pair).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindBoundedSubStrings("an") )
#--> [ [ 2, 3 ], [ 4, 5 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindSubStringBounds
FindSubStringBounds(pcSub): the FLAT start positions of the bound runs (left then right, per bounded occurrence, in order).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringBounds("an") )
#--> [ 1, 4, 3, 6 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveTrailingSubString
Same as RemoveTrailingChars: Drop the whole trailing run of the string's last char (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveTrailingSubString()
? o1.Content()
#--> banana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFind the position of the next n-th marker after nFrom.
1 exemples exécutésaussi écrite: FindNextNthMarkerexemple composé
o1 = new stzString("banana split")
? o1.FindNextNthMarquer(2, 5)
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSTContainsSubStringBoundedBy(pcSub, pacBounds): TRUE if pcSub appears inside any bounded section.
1 exemples exécutés# '♥♥♥' is enclosed by '^^' .. '^^'
? Q("^^♥♥♥^^").ContainsSubStringBoundedBy("♥♥♥", [ "^^", "^^" ])
#--> 1test de la bibliothèqueQCSXTZZZIBWUFindAsSectionsStD
(Haro is case-insensitive; one method name covers StD / STD.)
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAsSectionsStD("an", 2, :Forward) )
#--> [ [ 2, 3 ], [ 4, 5 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionHexUnicodes
HexUnicodes(): hex codepoints for every char, returned as a list.
aussi écrite: HexUnicodes_aliasexemple composé
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" ]composé à partir de la signature, exécuté pour cette page aucune extensionFirst2CharsAsString
First2CharsAsString / Last2CharsAsString: aliases.
exemple composé
o1 = new stzString("banana split")
? o1.First2CharsAsString()
#--> bacomposé à partir de la signature, exécuté pour cette page aucune extensionLast2CharsAsString
The last two chars, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.Last2CharsAsString()
#--> itcomposé à partir de la signature, exécuté pour cette page aucune extensionRemoveSpacesQ_alias
RemoveSpacesQ on stzString -- fluent form (existing RemoveSpaces at line ~6094 isn't followed by a Q form). Wrap and return This.aucune 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 exemples exécutéso1 = 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!test de la bibliothèqueQCSXTZZZIBWUShrink(): 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 exemples exécutéso1 = new stzString("ABCDE")
o1.Shrink( :ToPosition = 3 )
# 'ABCDE' shrunk to position 3
? o1.Content()
#--> ABCtest de la bibliothèqueQCSXTZZZIBWUShortenN(n): same as ShortenedN but mutates in place.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.ShortenN(2)
? o1.Content()
#--> ba...itcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsInSections(pcSub, aSections): TRUE if pcSub appears inside ANY of the listed sections.
1 exemples exécutéso1 = 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
#--> 1test de la bibliothèqueaucune extensionContainsBefore(pcSub, pcAnchor | :Position = n | :SubString = s): TRUE iff pcSub appears in the content BEFORE the anchor.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsBefore("an", "an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if pcSub occurs AFTER the anchor substring.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsAfter("an", "an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionContainsOnlyOneOfThese(paSubStr): TRUE iff EXACTLY ONE of the listed substrings appears in the content (counting at least one occurrence as 1).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyOneOfThese([ "an", "a" ])
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsReverseOf
IsReverseOf(pcOther): TRUE iff This.Content() is the reverse of pcOther (codepoint-by-codepoint).
exemple composé
o1 = new stzString("banana split")
? o1.IsReverseOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHexUnicode
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.
exemple composé
o1 = new stzString("banana split")
? o1.HexUnicode()
#--> U+0062composé à partir de la signature, exécuté pour cette page aucune extensionFirst2Chars
The first two chars, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.First2Chars() )
#--> [ "b", "a" ]composé à partir de la signature, exécuté pour cette page aucune extensionLast2Chars
The last two chars, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Last2Chars() )
#--> [ "i", "t" ]composé à partir de la signature, exécuté pour cette page aucune extensionLast3Chars
The last three chars, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Last3Chars() )
#--> [ "l", "i", "t" ]composé à partir de la signature, exécuté pour cette page aucune extensionFirst3Chars
The first three chars, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.First3Chars() )
#--> [ "b", "a", "n" ]composé à partir de la signature, exécuté pour cette page aucune extensionThe first n chars, as a string.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FirstNChars(2)
#--> bacomposé à partir de la signature, exécuté pour cette page aucune extensionThe last n chars, as a string.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.LastNChars(2)
#--> itcomposé à partir de la signature, exécuté pour cette page aucune extensionExtendToNChars(n): pad content with spaces up to length n.
1 exemples exécutéso1 = new stzString("ABC")
o1.ExtendToNChars(5)
# 'ABC' padded to width 5
? o1.Content()
#--> ABCtest de la bibliothèqueQCSXTZZZIBWUSpacified / SpacifiedUsing / SpacifiedXT: non-mutating Spacify variants. Return the spaced-out string without altering This.
3 exemples exécutésaussi nommée: add spaces between characters space out letter spacing# spaces between
? Q("SOFTANZA").Spacified()
#--> S O F T A N Z Atest de la bibliothèqueQCSXTZZZIBWUA copy with the chars separated by the given separator.
1 exemples exécutéso1 = 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_9test de la bibliothèqueaucune extensionSpacifyTheseSubStrings(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 exemples exécutéso1 = 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 Majditest de la bibliothèqueQCSXTZZZIBWUSplitAtSections
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).aucune extension
SplitAtCharsW(pcCondition): split content at every char where the predicate is TRUE. Same semantics as SplitW, spelled for char-narratives.
1 exemples exécutés# 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" ]test de la bibliothèqueaucune extensionCommonSubStrings
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).aucune extension
EndsWithNumberN(pcNumStr): TRUE if the content ENDS with the given number-as-string. Accepts optional leading sign in pcNumStr.
3 exemples exécutésaussi écrite: EndsWithThisNumberexemple composé
o1 = new stzString("banana split")
? o1.EndsWithNumberN("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune 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 exemples exécutéso1 = new stzString("<<Go!>>")
# the bounds fall away
? o1.TheseBoundsRemoved("<<", ">>")
#--> Go!test de la bibliothèqueQCSXTZZZIBWURemoveEmptyLines
RemoveEmptyLines / RemoveEmptyLinesQ: drop lines that are empty (after trim).QCSXTZZZIBWU
TRUE if the string's dominant script is the given one.
2 exemples exécutésaussi écrite: IsScriptOf# spaces are Common
? StzStringQ(" ").IsScriptOf(:Common)
# a dhammah is Inherited
? StzStringQ(ArabicDhammah()).IsScriptOf(:Inherited)
#--> 1
#--> 1test de la bibliothèqueaucune extensionRemoveAt
RemoveAt -- two shapes: RemoveAt(n) -- remove single char at position n RemoveAt(n, pcSub) -- remove pcSub at position n
exemple composé
o1 = new stzString("banana split")
o1.RemoveAt(2, "an")
? o1.Content()
#--> bana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsQuietEqualTo(pcOther): "quiet" equality -- accept up to ~30% char-level mismatches. Useful for fuzzy comparisons. Uses Levenshtein-style distance with simple thresholding.
3 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsQuietEqualTo("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNextOccurrence(pcSub, nFrom): position of the next occurrence of pcSub strictly after nFrom.
2 exemples exécutéso1 = 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
#--> 11test de la bibliothèqueaucune extensionPreviousOccurrence
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).
exemple composé
o1 = new stzString("banana split")
? o1.PreviousOccurrence("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRepeatedLeadingChar(): the single char that begins a leading run of repeated chars (or "" if no run).
2 exemples exécutéso1 = new stzString("exeeeeeTUNIS")
# no repeated leading char
? o1.RepeatedLeadingChar()
# empty list
? len( o1.RepeatedLeadingChars() )
#--> 0test de la bibliothèqueaucune extensionRepeatedTrailingChar
The char repeated at the end of the string.aucune extension
NumberOfRepeatedLeadingChars
How long the repeated run at the start is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfRepeatedLeadingChars()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfRepeatedTrailingChars
How long the repeated run at the end is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfRepeatedTrailingChars()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSectionsOfSameItems
SectionsOfSameItems(): contiguous runs of equal chars as [start, end] sections.
exemple composé
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 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceAnyBoundedBy(pacBounds, pcNew): wrapper over the substrings-bounded-by-replace family.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.ReplaceAnyBoundedBy([ "an", "a" ], "AN")
? o1.Content()
#--> banANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceManyPairs
(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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.AntiFindAsSection("an") )
#--> [ 1, 1 ]composé à partir de la signature, exécuté pour cette page aucune extensionTrailing/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 exemples exécutésaussi écrite: EndingNumberaucune extensionThe number the string STARTS with, as a string (empty if none).
1 exemples exécutésaussi écrite: StartingNumberaucune extensionNumberOfTrailingNumberDigits
How many digits the trailing number has.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfTrailingNumberDigits()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfLeadingNumberDigits
How many digits the leading number has.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLeadingNumberDigits()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionBounds
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 "!>>").
exemple composé
o1 = new stzString("banana split")
? @@( o1.Bounds() )
#--> [ "b", "t" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUBoundsBetween
The [open, close] bounds found between the given pair.
exemple composé
o1 = new stzString("banana split")
? @@( o1.BoundsBetween("an", "an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionHasRepeatedLeadingChars(): TRUE if the content begins with a run of identical chars (length >= 2).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HasRepeatedLeadingChars()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHasRepeatedTrailingChars
TRUE if the string ends with a repeated char run.
exemple composé
o1 = new stzString("banana split")
? o1.HasRepeatedTrailingChars()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionExcept
Except(pcSub): the content with all occurrences of pcSub removed.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Except("an") )
#--> [ "b", "a split" ]composé à partir de la signature, exécuté pour cette page aucune extensionNth(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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.Nth(2, "an")
#--> 4composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSTDNthChar1
The char at position n (lenient 1-based form).
exemple composé
o1 = new stzString("banana split")
? o1.NthChar1(2)
#--> acomposé à partir de la signature, exécuté pour cette page aucune extensionLastNItemsQRT
(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.
exemple composé
o1 = new stzString("banana split")
? o1.LastNItemsQRT(2, "an")
#--> itcomposé à partir de la signature, exécuté pour cette page aucune extensionFirstNItemsQRT
The first n chars, in the requested return type (QRT).
exemple composé
o1 = new stzString("banana split")
? o1.FirstNItemsQRT(2, "an")
#--> bacomposé à partir de la signature, exécuté pour cette page aucune extensionFindLastAsSection
FindLastAsSection: [start, end] of the last occurrence of pcSub.
aussi écrite: FindLasteAsSectionexemple composé
o1 = new stzString("banana split")
? @@( o1.FindLastAsSection("an") )
#--> [ 4, 5 ]composé à partir de la signature, exécuté pour cette page aucune extensionFindPrevious(pcSub, nFrom): mirror of NextOccurrence -- highest position strictly before nFrom.
6 exemples exécutéso1 = new stzString("[••[•[••]•[•]]••[••]]")
? o1.FindNext("[", :StartingAt = 17)
? o1.FindPrevious("]", :StartingAt = 13)
#--> 0
#--> 9test de la bibliothèqueaucune extensionThe position of the nth occurrence STRICTLY BEFORE the given position.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindPreviousNth(2, "an", 5)
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionLeftCharRemoved
LeftCharRemoved / RightCharRemoved: non-mutating singular.
exemple composé
o1 = new stzString("banana split")
? o1.LeftCharRemoved()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionRightCharRemoved
A copy with the last (rightmost) char removed.
exemple composé
o1 = new stzString("banana split")
? o1.RightCharRemoved()
#--> banana splicomposé à partir de la signature, exécuté pour cette page aucune extensionCapitalCased(): 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.CapitalCased()
#--> Banana Splitcomposé à partir de la signature, exécuté pour cette page aucune extensionCapitalCase
Capitalize the string in place (mutating). For a copy, use CapitalCased.QCSXTZZZIBWU
IsMadeOfNumbers(): TRUE if EVERY char is a digit.
1 exemples exécutésaussi écrite: 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
#--> 1test de la bibliothèqueaucune extensionIsMadeOfLetters
TRUE if the string is made of letters only.
exemple composé
o1 = new stzString("banana split")
? o1.IsMadeOfLetters()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSplitToPartsOfSizes
SplitToPartsOfSizes(anSizes): split into pieces of the given sizes.aucune extension
IsStepNamedParam
IsStepNamedParam(): TRUE if content is [:step, value]. Used by parser narratives.aucune extension
UpdateWith(pcNew): replace content with pcNew. Alias of Update.
1 exemples exécutéso1 = new stzString("999999999999")
o1.UpdateWith("999 999 999.999")
# the content becomes the new value
? o1.Content()
#--> 999 999 999.999test de la bibliothèqueQCSXTZZZIBWURemoveCharFromLeft(pcChar): drop leading chars matching pcChar.
1 exemples exécutésQCSXTZZZIBWURemoveCharFromRight
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.NthAsSection(2, "an") )
#--> [ 4, 5 ]composé à partir de la signature, exécuté pour cette page aucune extensionLeftBound
The opening (left) bound of the string.
exemple composé
o1 = new stzString("banana split")
? o1.LeftBound()
#--> bcomposé à partir de la signature, exécuté pour cette page aucune extensionRightBound
The closing (right) bound of the string.
exemple composé
o1 = new stzString("banana split")
? o1.RightBound()
#--> tcomposé à partir de la signature, exécuté pour cette page aucune extensionCharsInverted
CharsInverted: each char's case toggled.
exemple composé
o1 = new stzString("banana split")
? @@( o1.CharsInverted() )
#--> [ "B", "A", "N", "A", "N", "A", " ", "S", "P", "L", "I", "T" ]composé à partir de la signature, exécuté pour cette page aucune extensionInvertCharsCase
Swap the case of every char in place (mutating, engine-backed).aucune extension
ToStzTable
ToStzTable: stub returning content as a single-cell table.aucune 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.aucune extension
FindPreviousOccurrences
The previous occurrence of the substring from the given start position: the position(s).aucune extension
TRUE if the string holds a contiguous list, any form.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsContiguousListInString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionItemsAndTheirNumberOfOccurrence
Each char paired with how many times it occurs.
exemple composé
o1 = new stzString("banana split")
? @@( o1.ItemsAndTheirNumberOfOccurrence() )
#--> [ [ "b", 1 ], [ "a", 3 ], [ "n", 2 ], [ " ", 1 ], [ "s", 1 ], [ "p", 1 ], [ "l", 1 ], [ "i", 1 ], [ "t", 1 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionLast3CharsAsString
The last three chars, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.Last3CharsAsString()
#--> litcomposé à partir de la signature, exécuté pour cette page aucune extensionFirst3CharsAsString
The first three chars, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.First3CharsAsString()
#--> bancomposé à partir de la signature, exécuté pour cette page aucune extensionNext3Chars
More codepoint convenience slices. Next3Chars(:StartingAt = n): the 3 chars AFTER position n (a LIST); Next3CharsAsString returns them as a substring.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Next3Chars(3) )
#--> [ "a", "n", "a" ]composé à partir de la signature, exécuté pour cette page aucune extensionCharRemovedFromLeft
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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStrings()
#--> 57composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfConsecutiveSubStringsOf
How many CONSECUTIVE repetitions of pcSub the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStringsOf("an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionENGINE-BACKED (StzEngineStringConsecutiveSubStrings): all window tilings 1..floor(len/2). Retires the O(len^2) Haro double-loop.
2 exemples exécutésoA = 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
#--> 999test de la bibliothèqueQCSXTZZZIBWUFindConsecutiveSubStrings
The original Find form returns the UNIQUE per-length indices, which reduce to [1..n] (the length-1 row alone spans them all).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindConsecutiveSubStrings() )
#--> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame 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 exemples exécutés# ShortenedUsing(' {...} ') keeps 3 each side
? Q("1234567890987654321").ShortenedUsing(" {...} ")
# ShortenedNUsing(5, ' {...} ') keeps 5 each side
? Q("1234567890987654321").ShortenedNUsing(5, " {...} ")
#--> 123 {...} 321
#--> 12345 {...} 54321test de la bibliothèqueaucune extensionBoundsRemoved(): drop the auto-detected leading + trailing non-letter bounds.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.BoundsRemoved()
#--> anana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNumberOfConsecutiveSubStringsOfNChars
How many consecutive n-char chunks the string splits into.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStringsOfNChars(2)
#--> 11composé à partir de la signature, exécuté pour cette page aucune extensionUnspacify(): trim, then collapse each run of 2+ spaces to one (the original monolith: Trim + remove dup-consecutive spaces).
1 exemples exécutéso1 = new stzString(" so ftan za ")
o1.Unspacify()
# edges trimmed, the 3-space run collapsed
? o1.Content()
#--> so ftan zatest de la bibliothèqueQCSXTZZZIBWUA copy with the spaces removed; the original is unchanged.
3 exemples exécutés# "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 gtest de la bibliothèqueaucune extensionThe position of the nth occurrence of pcSub after the given position (0 when there is none).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindNthNext(2, "an", 5)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionFindNthPrevious / FindNthNext on stzString.
3 exemples exécutéso1 = new stzString("12♥4♥67")
# previous from 5
? o1.FindPrevious("♥", :StartingAt = 5)
# 2nd previous from 6
? o1.FindNthPrevious(2, "♥", :StartingAt = 6)
#--> 3
#--> 3test de la bibliothèqueaucune extensionFirstZ
FirstZ(sub) -- the Z grouping [sub, position] of the first occurrence (0-arg keeps the first-char section form).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FirstZ("an") )
#--> [ "an", 2 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWULastZ
The last char along with its position.
exemple composé
o1 = new stzString("banana split")
? @@( o1.LastZ() )
#--> [ 12, 12 ]composé à partir de la signature, exécuté pour cette page aucune extensionVizFind / VizFindCSXT / VizFindXT -- visualization (returns a rendered string showing match positions). Provisional: just return the content with matched chars highlighted via ASCII.
3 exemples exécutés# four carets on the rail
? StzStringQ("ABTCADNBBABEFACCC").VizFind("A")
#--> ABTCADNBBABEFACCC
#--> ^---^----^---^---test de la bibliothèqueQCSXTZZZIBWUManyConsecutiveSubStringsOfNChars
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.ConsecutiveSubStringsOfNChars(2) )
#--> [ "ba", "na", "na", " s", "pl", "it", "an", "an", "a ", "sp", "li" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindNthAsSection
FindNthAsSection(n, pcSub): [start, end] of the n-th occurrence.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindNthAsSection(2, "an") )
#--> [ 4, 5 ]composé à partir de la signature, exécuté pour cette page aucune extensionNthStz
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
exemple composé
o1 = new stzString("banana split")
? @@( o1.NthStz(2, "an", 2) )
#--> [ "an", 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionFindNthSZZ
The nth occurrence of the substring from the given start position, as [start, end] section(s).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindNthSZZ(2, "an", 2) )
#--> [ "an", [ 4, 5 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionFirstSTDZ
FirstSTDZ(pcSub, nStartAt, pDir): pos only (no section). The STDZ/STDZZ forms carry the [sub, pos] / [sub, span] grouping.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FirstSTDZ("an", 2, :Forward) )
#--> [ "an", 2 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUCharsInSection
CharsInSection(n1, n2): the chars in the [n1, n2] section as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.CharsInSection(2, 5) )
#--> [ "a", "n", "a", "n" ]composé à partir de la signature, exécuté pour cette page aucune extensionReplaceInSections
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 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.ReplaceCharsW("@char = 'a'", "AN")
? o1.Content()
#--> bANnANnAN splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceEachLeadingChar(pcNewChar): replace every leading run char with pcNewChar.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.ReplaceEachLeadingChar("AN")
? o1.Content()
#--> ANanana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplace EACH char of the trailing run with the given char (mutating).
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.ReplaceEachTrailingChar("AN")
? o1.Content()
#--> banana spliANcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as ReplaceEachLeadingChar: ReplaceEachLeadingChar(pcNewChar): replace every leading run char with pcNewChar.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.ReplaceEachLeadingAndTrailingChar("AN")
? o1.Content()
#--> ANanana spliANcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceSubStringsWithMarquers
ReplaceSubStringsWithMarquers: turn the listed substrings INTO their ordinal marquers (#1, #2, ...) -- the inverse of ReplaceMarquers.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceSubStringsWithMarquers([ "an", "a" ])
? o1.Content()
#--> b#1#1#2 splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceSubStringsWithMarkers
Same as ReplaceSubStringsWithMarquers: ReplaceSubStringsWithMarquers: turn the listed substrings INTO their ordinal marquers (#1, #2, ...) -- the inverse of ReplaceMarquers.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceSubStringsWithMarkers([ "an", "a" ])
? o1.Content()
#--> b#1#1#2 splitcomposé à partir de la signature, exécuté pour cette page aucune extensionUnicodeDataAsStringEmpty
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.aucune extension
LastSTDZ
LastSTDZ / LastSTDZZ: positional / sectional last-occurrence directional search from a starting position.
exemple composé
o1 = new stzString("banana split")
? @@( o1.LastSTDZ("an", 2, :Forward) )
#--> [ "an", 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindOccurrences
FindOccurrences(pcSub | anN, :Of = pcSub): all positions, or select positions of nth-occurrences from a list.aussi écrite: 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.)
exemple composé
o1 = new stzString("banana split")
? o1.NthStzS(2, "an", 2)
#--> 4composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNext3CharsAsString
The three chars after the given position, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.Next3CharsAsString(3)
#--> anacomposé à partir de la signature, exécuté pour cette page aucune extensionFirstStz
FirstStz / LastStz: the [sub, position] grouping of the first / last occurrence at or after :StartingAt (the S = starting-at family is forward-looking).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FirstStz("an", 2) )
#--> [ "an", 2 ]composé à partir de la signature, exécuté pour cette page aucune extensionLastStz
The last occurrence: the substring paired with its position, from the given start position (an empty list when there is no match).
exemple composé
o1 = new stzString("banana split")
? @@( o1.LastStz("an", 2) )
#--> [ "an", 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionCharTrimmedFromLeft
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)aucune extension
CharTrimmedFromRight
Same as CharRemovedFromRightXT: A copy with the trailing run of pcChar dropped; the original is unchanged.aucune extension
FindLastSZZ
The SZZ forms group [sub, [start, end]] (per the original archive: FindLastSZZ("♥♥♥", :StartingAt = 6) --> [ "♥♥♥", [13, 15] ]).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindLastSZZ("an", 2) )
#--> [ "an", [ 4, 5 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionFindFirstSZZ
The first occurrence of the substring from the given start position, as [start, end] section(s).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindFirstSZZ("an", 2) )
#--> [ "an", [ 2, 3 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionFindTheseOccurrencesAsSections
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]], ... ].
exemple composé
o1 = new stzString("banana split")
? @@( o1.TheseSubstringsZ([ "an", "a" ]) )
#--> [ [ "an", [ 2, 4 ] ], [ "a", [ 2, 4, 6 ] ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitAroundCS_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.aucune 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 exemples exécutés# the named-param shape is recognised
? Q(:IsBoundedBy = ".").IsIsBoundedByNamedParam()
# the direct check
? Q(".♥.").SubStringIsBoundedBy("♥", ".")
# the SubStringXT spelling
? Q(".♥.").SubStringXT("♥", :IsBoundedBy = ".")
#--> 1
#--> 1
#--> 1test de la bibliothèqueaucune extensionIsIsBoundedByNamedParam
IsIsBoundedByNamedParam: predicate on the content list for the :IsBoundedBy named-param shape. Returns TRUE iff content is a 2-elem list [:IsBoundedBy, ...].aucune extension
CommonItems
CommonItems(:With = pcOther): same idea as CommonSubStrings but at the CHAR level (intersection of char sets).aucune 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 exemples exécutéso1 = new stzString("125.450")
o1.RemoveNthChar(7)
# the 7th char is gone
? o1.Content()
#--> 125.45test de la bibliothèqueQCSXTZZZIBWUAntiFind
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.AntiFind("an") )
#--> [ 1, 6, 7, 8, 9, 10, 11, 12 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitAroundCSNamed
SplitAroundCS alias delegating to existing.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAroundCSNamed("an", 2) )
#--> [ "b", "", "a split" ]composé à partir de la signature, exécuté pour cette page aucune extension>= n occurrences (canonical + misspelled alias)
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringsOccuringNTimes(2) )
#--> [ "a", "an", "n", "na" ]composé à partir de la signature, exécuté pour cette page aucune extension= n occurrences The substrings occurring EXACTLY n times.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringOnlyNTimes(2) )
#--> [ "an", "n", "na" ]composé à partir de la signature, exécuté pour cette page aucune extensionYieldCharsW(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 exemples exécutés# 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" ]test de la bibliothèqueaucune extensionSplitToPartsOfNChars
SplitToPartsOfNChars(n): split into pieces of EXACTLY n chars -- a shorter trailing remainder is DROPPED (the XT form keeps it).
aussi écrite: SplitToPartsOfExactlyNCharsexemple composé
o1 = new stzString("banana split")
? @@( o1.SplitToPartsOfNChars(2) )
#--> [ "ba", "na", "na", " s", "pl", "it" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNextNChars
PreviousNChars / NextNChars: the n chars before / after the first occurrence of a delimiter substring.
aussi écrite: NextNItemsexemple composé
o1 = new stzString("banana split")
? o1.NextNChars("an", 2)
#--> ancomposé à partir de la signature, exécuté pour cette page aucune extensionPreviousNChars
The n chars before the given anchor (position or substring).
aussi écrite: PreviousNItemsexemple composé
o1 = new stzString("banana split")
? o1.PreviousNChars("an", 2)
#--> bcomposé à partir de la signature, exécuté pour cette page aucune extensionFindNumbers
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).aucune extension
SubStringsOccurringExactlyNTimes
The substrings occurring EXACTLY n times.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringExactlyNTimes(2) )
#--> [ "an", "n", "na" ]composé à partir de la signature, exécuté pour cette page aucune extensionSubStringsOccurringNTimes
The substrings occurring AT LEAST n times.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringNTimes(2) )
#--> [ "a", "an", "n", "na" ]composé à partir de la signature, exécuté pour cette page aucune extensionNumbrifyQ
NumbrifyQ / NumbrifiedQ: alias for ToNumber wrap.aussi écrite: NumbrifiedQaucune extension
TRUE if the string starts with the given number (prefix equality).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.StartsWithThisNumber("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSplitToPartsOfNCharsXTOpt
Split into n-char parts with options (keep-remainder form).
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitToPartsOfNCharsXTOpt(2, 5) )
#--> [ "ba", "na", "na", " s", "pl", "it" ]composé à partir de la signature, exécuté pour cette page aucune extensionNumbersAndTheirPositions
Same as NumbersZ: The numbers embedded in the string, each with its position.aucune extension
NumbersAndTheirSections
Same as NumbersZZ: The numbers embedded in the string, each with its [start, end] section.aucune extension
NthNumberComingAfter
NthNumberComingAfter(n, pcAnchor): the n-th number after pcAnchor.
exemple composé
o1 = new stzString("banana split")
? o1.NthNumberComingAfter(2, "an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsNotLetter() -- TRUE if This is NOT a single letter char. (IsLetter already exists above; just add the negation.)
1 exemples exécutés# * is not a letter, computationally
? NOT Q("*").IsLetter()
# ... and linguistically
? Q("*").IsNotLetter()
#--> 1
#--> 1test de la bibliothèqueaucune extensionIsAtCharsNamedParam
IsAtCharsNamedParam(): TRUE iff content is [:AtChars, value]. We're a string -> always FALSE.aucune 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 exemples exécutés# the pieces between the positions remain
? @@( Q("---4---8---").SplitAroundPositions([ 4, 8 ]) )
#--> [ "---", "---", "---" ]test de la bibliothèqueaucune extensionIsPluralOfThisStzType(pcType): TRUE if content is the plural form of pcType (i.e. equal to pcType + "s").
1 exemples exécutés# stzchars is a plural of a stz type
? Q("stzchars").IsPluralOfAStzType()
# ... specifically of stzchar
? Q("stzchars").IsPluralOfThisStzType("stzchar")
#--> 1
#--> 1test de la bibliothèqueaucune extensionInfereMethod(: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 exemples exécutés# punctuation infers its checker
? Q("punctuation").InfereMethod(:From = :stzChar)
# the plural falls back to the singular
? Q("punctuations").InfereMethod(:From = :stzChar)
#--> ispunctuation
#--> ispunctuationtest de la bibliothèqueaucune extensionDuplicatedCharsRemoved
A copy with the duplicated chars removed; the original is unchanged.
exemple composé
o1 = new stzString("banana split")
? o1.DuplicatedCharsRemoved()
#--> ban splitcomposé à partir de la signature, exécuté pour cette page aucune extensionA stzString IS a string (stzChar answers TRUE via its own def).
1 exemples exécutés# a stzString is a string
? StzStringQ("s").IsString()
# a stzChar is a string too
? StzCharQ("s").IsString()
#--> 1
#--> 1test de la bibliothèque · écrit IsAString() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsString(), et Haro supprime le détouraucune extensionIsAFunction: is the content the name of a DEFINED function (per the original monolith: functions() lookup)? The call-looking check is IsAlmostAFunctionCall.
1 exemples exécutésaussi écrite: IsFunc · IsAFunctionName# stzLen is a function
? Q("stzLen").IsFunction()
# stzChar is a class
? Q("stzChar").IsClass()
#--> 1
#--> 1test de la bibliothèque · écrit IsAClass() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsClass(), et Haro supprime le détour; écrit IsAFunction() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsFunction(), et Haro supprime le détouraucune extensionIsAnInteger
TRUE if the string is an integer literal (trimmed).
aussi écrite: IsIntegerexemple composé
o1 = new stzString("banana split")
? o1.IsAnInteger()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionFindSpaces
FindSpaces() / FindEmptyStrings(): positions of every " ".
aussi écrite: FindEmptyStringsexemple composé
o1 = new stzString("banana split")
? @@( o1.FindSpaces() )
#--> [ 7 ]composé à partir de la signature, exécuté pour cette page aucune extensionCheck([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 exemples exécutés? Q("(,,)").Check(:That = 'StzCharQ(@Char).IsPunctuation()')
#--> 1test de la bibliothèqueaucune extensionSubStringsOccurringLessThanNTimes
The substrings occurring fewer than n times.aussi écrite: SubStringsOccurringNoMoreThanNTimesaucune extension
Removed
A copy of the string with every occurrence of pcWhat removed; the original is unchanged.
exemple composé
o1 = new stzString("banana split")
? o1.Removed("an")
#--> ba splitcomposé à partir de la signature, exécuté pour cette page aucune extensionIsBoundOfXT
IsBoundOfXT(:Open=, :Close=) -- TRUE iff the content equals one of the bounds (i.e. it IS the opening or closing string).
exemple composé
o1 = new stzString("banana split")
? o1.IsBoundOfXT(2, 5)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsAClass(): TRUE if content is a Haro class name (lookup via Haro's classes() introspection).
1 exemples exécutés# stzLen is a function
? Q("stzLen").IsFunction()
# stzChar is a class
? Q("stzChar").IsClass()
#--> 1
#--> 1test de la bibliothèque · écrit IsAClass() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsClass(), et Haro supprime le détour; écrit IsAFunction() dans la bibliothèque aujourd'hui : le langage hôte tient déjà IsFunction(), et Haro supprime le détouraucune extensionCombinations
Combinations(n): every n-char combination from the content.aucune extension
IsNotAString
IsNotAString(): TRUE iff content is NOT a string. We're a stzString -- always FALSE.
exemple composé
o1 = new stzString("banana split")
? o1.IsNotAString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionAreBoundsOfXT
AreBoundsOfXT(:Open=, :Close=): TRUE iff THIS contains both bounds; the IsBoundOfXT predicate flipped to "we contain something bounded by these".
exemple composé
o1 = new stzString("banana split")
? o1.AreBoundsOfXT(2, 5)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRandomPositionAfter
RandomPositionAfter(nFrom): a random codepoint position strictly after nFrom (inclusive of the last position).aucune extension
ContainsMoreThenN(n, pcSub) or (pcSub, n): TRUE iff content contains pcSub strictly more than n times.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsMoreThenN("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsMoreThanN
TRUE if pcSub occurs MORE than n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsMoreThanN("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionContainsAtLeastN
TRUE if pcSub occurs at least n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAtLeastN("an", 2)
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionContainsExactlyN
TRUE if pcSub occurs exactly n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsExactlyN("an", 2)
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionIsMarquer
IsMarquer / IsMarker: TRUE iff content is a "#N" marker token.
aussi écrite: IsMarkerexemple composé
o1 = new stzString("banana split")
? o1.IsMarquer()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfEmptyLines
NumberOfEmptyLines(): count blank lines (after trim).
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfEmptyLines()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfNonEmptyLines
How many non-empty lines the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfNonEmptyLines()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionBoundsUpToNChars
The string's bounds, capped to n chars each.aucune extension
Move(n1, n2): move char from position n1 to position n2. Accepts named-param form Move(:CharFromPosition = N, :To = M).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.Move(2, 5)
? o1.Content()
#--> bnaana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSwap(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 exemples exécutéso1 = new stzString("TWO, ONE, THREE!")
o1.Swap("TWO", :And = "ONE")
# the words traded places
? o1.Content()
#--> ONE, TWO, THREE!test de la bibliothèqueQCSXTZZZIBWUNthToLast(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 exemples exécutés# SOFTANZA's 3rd-to-last is A
? Q("SOFTANZA").NthToLast(3)
#--> Atest de la bibliothèqueaucune extensionUniqueSubStringsBoundedBy
Same as SubStringsBoundedByU: SubStringsBoundedByU: the UNIQUE bounded substrings ("U" = unique, not case-insensitive -- the settled Z/U convention).aucune extension
Positions
Positions(pcSub): all positions of pcSub (alias of AllPositionsOf; accepts the :Of / :OfSubString named spelling).
aussi écrite: FindPositionsexemple composé
o1 = new stzString("banana split")
? @@( o1.Positions("an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page aucune extensionFindNthBoundedBy
FindNthBoundedBy(n, pacBounds, pcSub): position of the n-th occurrence of pcSub inside any bounded section.
exemple composé
o1 = new stzString("banana split")
? o1.FindNthBoundedBy(2, [ "an", "a" ], "an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURanges
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.
exemple composé
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" ] ]composé à partir de la signature, exécuté pour cette page aucune extensionRemoveBoundedSubString(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 exemples exécutéso1 = 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 <<>> wordtest de la bibliothèqueQCSXTZZZIBWURemoveAnySubStringBoundedBy: remove every bounded region's CONTENT (the bounds stay); the IB form removes bounds too.
2 exemples exécutéso1 = new stzString("bla bla <<word>> bla bla <<noword>> bla <<word>>")
o1.RemoveAnySubStringBoundedBy([ "<<", ">>" ])
# the shells remain
? o1.Content()
#--> bla bla <<>> bla bla <<>> bla <<>>test de la bibliothèqueQCSXTZZZIBWUSubStringBounds
SubStringBounds(pcSub): the FLAT bound-run SUBSTRINGS of every bounded occurrence (left then right, in order) -- ["<<", ">>", "<<", ">>", ...].
exemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringBounds("an") )
#--> [ "b", "a", "n", "a" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindTheseSubStringBounds
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).
exemple composé
o1 = new stzString("banana split")
? o1.IsRightToLeft()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe n rightmost chars, direction-aware, as a string.
1 exemples exécutéso1 = new stzString("هذه الكلمات الّتي سوف تبقى")
# the right 4 chars open the text
? o1.NRightCharsAsSubstring(4)
o1.RemoveFromRight("هذه ")
# removing from the right trims the start
? o1.Content()
#--> هذه
#--> الكلمات الّتي سوف تبقىtest de la bibliothèqueaucune extensionNLeftCharsAsSubString
The n leftmost chars, direction-aware, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.NLeftCharsAsSubString(2)
#--> bacomposé à partir de la signature, exécuté pour cette page aucune extensionRemoveNthOccurrence(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 exemples exécutéso1 = new stzString("**A1****A2***A3")
o1.RemoveNthOccurrence(:Last, "A")
# the third A is gone
? o1.Content()
#--> **A1****A2***3test de la bibliothèqueQCSXTZZZIBWUAddBounds([pcOpen, pcClose]): wrap content with bounds. 1-arg list form accepted: AddBounds(["<<", ">>"]).
1 exemples exécutéso1 = new stzString("word")
o1.AddBounds(["<<",">>"])
# bounded
? o1.Content()
#--> <<word>>test de la bibliothèqueQCSXTZZZIBWUBoundWith
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 exemples exécutésaussi écrite: StartsWithOneOfTheseexemple composé
o1 = new stzString("banana split")
? o1.BeginsWithOneOfThese([ "an", "a" ])
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUStartsWithEither
Same as StartsWithEitherCS: The second argument arrives as the pair [ :Or, "..." ]; a bare string is accepted too.aussi écrite: BeginsWithEitherQCSXTZZZIBWU
EndsWithOneOfThese
Same as EndsWithOneOfTheseCS: TRUE if the string ends with ANY of the given suffixes.
exemple composé
o1 = new stzString("banana split")
? o1.EndsWithOneOfThese([ "an", "a" ])
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUHasCentralChar(): TRUE iff content length is odd.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HasCentralChar()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsMultipleOf(pcUnit): TRUE iff content is pcUnit repeated.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsMultipleOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUMarquer
Marquer / Marker: the FIRST marker number. Marquer(): the marquer SYMBOL itself.
aussi écrite: Markerexemple composé
o1 = new stzString("banana split")
? o1.Marquer()
#--> #composé à partir de la signature, exécuté pour cette page aucune extensionContainsMarquers
TRUE if the string contains marquers.
aussi écrite: ContainsMarkersexemple composé
o1 = new stzString("banana split")
? o1.ContainsMarquers()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsIncludedIn
TRUE if the string occurs inside the given one.
aussi écrite: IncludedInexemple composé
o1 = new stzString("banana split")
? o1.IsIncludedIn("an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionReplaceSubStringAtPositions
ReplaceSubStringAtPositions(anPos, pcOld, pcNew). pcNew accepts :By = "..." named-param form.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceSubStringAtPositions([ 1, 2 ], "an", "AN")
? o1.Content()
#--> bANana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSortMarkersInDescending
Same as SortMarquersInDescending: Sort the marquers in descending order (mutating).aucune extension
SortMarkersInAscending
Same as SortMarquersInAscending: Sort the marquers in ascending order (mutating).aucune extension
MarquersAndPositions
Same as MarquersZ: MarquersZ: each marquer grouped with its start position.aucune 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).aucune extension
MarquersAndSections
Each marquer paired with its [start, end] section.aussi écrite: MarkersAndSectionsaucune 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).aucune extension
Remove every occurrence of the given char (mutating).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveChar(2)
? o1.Content()
#--> bnana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUA copy with the given char removed everywhere.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.CharRemoved(2)
#--> bnana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionRemove the char at position n only if it equals pcChar (mutating).
1 exemples exécutésQCSXTZZZIBWUTRUE if the chars are in ascending order.
2 exemples exécutés# is ascending
? Q("01233445679").IsSortedInAscending()
# not descending
? Q("01233445679").IsSortedInDescending()
#--> 1
#--> 0test de la bibliothèqueaucune extensionTRUE if the chars are in descending order.
3 exemples exécutés# is ascending
? Q("01233445679").IsSortedInAscending()
# not descending
? Q("01233445679").IsSortedInDescending()
#--> 1
#--> 0test de la bibliothèqueaucune extensionRemoveManySections
Remove the chars of each given [start, end] section (mutating).QCSXTZZZIBWU
Replace the nth occurrence AFTER the given position (mutating).
1 exemples exécutéso1 = new stzString( "----@@--@@-------@@----@@---")
o1.ReplaceNextNthOccurrence(2, :Of = "@@", :StartingAt = 12, :With = "##")
# the 2nd @@ after 12 became ##
? o1.Content()
#--> ----@@--@@-------@@----##---
test de la bibliothèqueQCSXTZZZIBWUReplace the nth occurrence BEFORE the given position (mutating).
1 exemples exécutéso1 = new stzString( "----@@--@@-------@@----@@---")
o1.ReplacePreviousNthOccurrence(2, :Of = "@@", :StartingAt = 22, :With = "##")
# the 2nd @@ before 22 became ##
? o1.Content()
#--> ----@@--##-------@@----@@---
test de la bibliothèqueQCSXTZZZIBWUTRUE if the string is the lowercase form of the given one.
2 exemples exécutés# in itself
? Q("date").IsLowercase()
# ... and of DATE
? Q("date").IsLowercaseOf("DATE")
#--> 1
#--> 1test de la bibliothèqueQCSXTZZZIBWUTRUE if the string is the uppercase form of the given one.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsUppercaseOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionUppercasedInLocale
UppercasedInLocale / LowercasedInLocale -- locale-neutral fallback.
exemple composé
o1 = new stzString("banana split")
? o1.UppercasedInLocale("an")
#--> BANANA SPLITcomposé à partir de la signature, exécuté pour cette page aucune extensionThe string lowercased for the given locale (plain lowercase fallback).
2 exemples exécutés# 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
#--> 0test de la bibliothèqueaucune extensionThe case of the single-char string (codepoint-aware).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.CharCase()
#--> mixedcomposé à partir de la signature, exécuté pour cette page aucune extensionCountInSections
How many occurrences of pcSub fall inside the given sections.
aussi écrite: NumberOfOccurrencesInSectionsexemple composé
o1 = new stzString("banana split")
? o1.CountInSections("an", [ "an", "a" ])
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSplits
Splits([pcSep]): split-on-separator words; 0-arg uses whitespace.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Splits(" ") )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveRanges
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.
exemple composé
o1 = new stzString("banana split")
o1.RemoveTheseSubStringBounds("an", [ "an", "a" ])
? o1.Content()
#--> ban splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUWalkForwardW
Walk forward collecting where the W condition holds (mirror of WalkBackwardW).
exemple composé
o1 = new stzString("banana split")
? @@( o1.WalkForwardW("@char = 'a'", 2) )
#--> [ 2, 4, 6 ]composé à partir de la signature, exécuté pour cette page aucune extensionFindWords
The position of each word of the string.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindWords() )
#--> [ 1, 8 ]composé à partir de la signature, exécuté pour cette page aucune extensionHasThisTrailingChar
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.)
exemple composé
o1 = new stzString("banana split")
? o1.HasThisTrailingChar("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUHasThisLeadingChar
Same as HasThisLeadingCharCS: TRUE if the string starts with the given char.
exemple composé
o1 = new stzString("banana split")
? o1.HasThisLeadingChar("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindTrailingChars
The positions of the trailing char run.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindTrailingChars() )
#--> [ 12 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindLeadingChars
The positions of the leading char run.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindLeadingChars() )
#--> [ 1 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUTRUE if the last char equals the given one.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.TrailingCharIs("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWULeadingCharIs
TRUE if the first char equals the given one.
exemple composé
o1 = new stzString("banana split")
? o1.LeadingCharIs("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUPositionOfCentralChar: position of the center char (0 if even).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.PositionOfCentralChar()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsNTimesMultipleOf(n, pcUnit): TRUE iff content is pcUnit repeated exactly n times.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsNTimesMultipleOf(2, "an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionMarkSubStringsCS
MarkSubStringsCS(pcSubStr, pCaseSensitive): mark every occurrence of pcSubStr with [|...|] (single-substring form).aucune extension
ReplaceMarquers
ReplaceMarquers(paReplacements): replace #1, #2, ... in order with paReplacements[1], [2], ... (engine-replace).aucune extension
ReplaceMarkers
Same as ReplaceMarquers: ReplaceMarquers(paReplacements): replace #1, #2, ... in order with paReplacements[1], [2], ... (engine-replace).aucune extension
FindInSections
the given sections (codepoint absolute positions).aucune extension
HasTrailingSubString
HasTrailingSubString(): TRUE iff content has any trailing word.
exemple composé
o1 = new stzString("banana split")
? o1.HasTrailingSubString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHasLeadingSubString
TRUE if the string has a leading repeated-char run.
exemple composé
o1 = new stzString("banana split")
? o1.HasLeadingSubString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHasTrailingSubStringOf
Same as EndsWithCS: Whether the string ends with the given suffix. (with the case-sensitivity dial)
exemple composé
o1 = new stzString("banana split")
? o1.HasTrailingSubStringOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionHasLeadingSubStringOf
Same as StartsWithCS: Whether the string starts with the given prefix. (with the case-sensitivity dial)
exemple composé
o1 = new stzString("banana split")
? o1.HasLeadingSubStringOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTrailingSubStringZZOf
The [start, end] section of the trailing run of pcSub.aucune extension
MarquersPositions
Object wrappers around stzStringFunc global helpers so they resolve inside StzStringQ(){...} blocks. Inline rather than delegate to avoid same-name recursion.aussi écrite: FindMarkers · FindMarquers · MarkersPositionsaucune 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 exemples exécutésaussi écrite: FirstMarkeraucune extensionThe position of the first marquer.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindFirstMarquer()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe nth marquer of the string.
1 exemples exécutésaussi écrite: NthMarkero1 = 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
#--> 26test de la bibliothèqueaucune extensionThe position of the nth marquer.
1 exemples exécutéso1 = 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
#--> 26test de la bibliothèqueaucune extensionThe position of the last marquer.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindLastMarquer()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe nth marquer after the given position.
1 exemples exécutéso1 = 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
#--> 44test de la bibliothèqueaucune extensionPreviousMarquers
The marquers before the given position.aucune extension
NextMarquers
The marquers after the given position.aucune 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).
aussi écrite: FindPreviousNthMarker · FindPreviousNthMarquerexemple composé
o1 = new stzString("banana split")
? o1.FindNthPreviousMarquer(2, 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionFindMarquersAsSections
The [start, end] section of every marquer.aussi écrite: FindMarkersAsSectionsaucune extension
UniqueMarquersAndTheirPositions
Same as MarquersUZ: The unique marquers, each with ALL its positions.aucune extension
UniqueMarquersAndTheirSections
Same as MarquersUZZ: The unique marquers, each with ALL its [start, end] sections.aucune extension
MarquerByPosition
The marquer covering the given position.aussi écrite: MarkerByPositionaucune extension
PreviousMarquerZ
PreviousMarquerZ: the nearest previous marquer with its position.aussi écrite: PreviousMarkerZaucune extension
MarquerByPositions
The marquer at each of the given positions.aussi écrite: MarkerByPositions · MarkersByPositions · MarquersByPositionsaucune extension
PreviousNthMarquerAndItsPosition
Same as PreviousNthMarquerZ: PreviousNthMarquerZ: the marquer with its position.aucune extension
TRUE if the given substring is bounded by the given bound(s).
1 exemples exécutés# the named-param shape is recognised
? Q(:IsBoundedBy = ".").IsIsBoundedByNamedParam()
# the direct check
? Q(".♥.").SubStringIsBoundedBy("♥", ".")
# the SubStringXT spelling
? Q(".♥.").SubStringXT("♥", :IsBoundedBy = ".")
#--> 1
#--> 1
#--> 1test de la bibliothèqueaucune extensionFindNextOccurrence
The position of the next occurrence of pcSub after the given position (0 when there is none).
exemple composé
o1 = new stzString("banana split")
? o1.FindNextOccurrence("an", 2)
#--> 4composé à partir de la signature, exécuté pour cette page aucune extensionUnicodesPerChar
The codepoint of each char, as a list.
exemple composé
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 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionUnicodeOfChar
The codepoint of the given char.
exemple composé
o1 = new stzString("banana split")
? o1.UnicodeOfChar("a")
#--> 97composé à partir de la signature, exécuté pour cette page aucune extensionTurn the content into its hex digest with the given algorithm (mutating, engine-backed).
1 exemples exécutésaussi nommée: digest checksum sha md5 fingerprinto1 = new stzString("original text before hashing")
o1.Hash(:MD5)
# the md5 hex digest
? o1.Content()
#--> 8ffad81de2e13a7b68c7858e4d60e263test de la bibliothèqueQCSXTZZZIBWUHashed
The hex digest of the content with the given algorithm, as data.aucune extension
EachCharBoxedRounded
Each char in its own rounded box cell.
aussi écrite: EachCharBoxRounded · EachCharBoxedRoundedDashedexemple composé
o1 = new stzString("banana split")
? o1.EachCharBoxedRounded()
#--> ╭───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───╮
#--> │ b │ a │ n │ a │ n │ a │ │ s │ p │ l │ i │ t │
#--> ╰───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───╯composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUTitlecasedInLocale
The string titlecased for the given locale (falls back to plain titlecase).
exemple composé
o1 = new stzString("banana split")
? o1.TitlecasedInLocale("an")
#--> Banana Splitcomposé à partir de la signature, exécuté pour cette page aucune extensionCapitalisedInLocale
Same as Titlecased: The string in Title Case (each word capitalized).
exemple composé
o1 = new stzString("banana split")
? o1.CapitalisedInLocale("an")
#--> Banana Splitcomposé à partir de la signature, exécuté pour cette page aucune extensionCapitalizedInLocale
Same as Titlecased: The string in Title Case (each word capitalized).
exemple composé
o1 = new stzString("banana split")
? o1.CapitalizedInLocale("an")
#--> Banana Splitcomposé à partir de la signature, exécuté pour cette page aucune extensionFindPreviousOccurrence
The position of the nearest occurrence of pcSub before the given position (0 when there is none).
exemple composé
o1 = new stzString("banana split")
? o1.FindPreviousOccurrence("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfLeadingItems
How long the leading char run is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLeadingItems()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfTrailingItems
How long the trailing char run is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfTrailingItems()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionRemoveRightOccurrence
Remove the LAST occurrence of pcSub (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveRightOccurrence("an")
? o1.Content()
#--> bana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsHybridOrientation
TRUE if the content mixes LTR (Latin) and RTL (Arabic-side) scripts.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsHybridOrientation()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRepresentsSignedRealNumber
TRUE if the string is a SIGNED real-number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsSignedRealNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRepresentsUnsignedRealNumber
TRUE if the string is an UNSIGNED real-number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsUnsignedRealNumber()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if the string is a 3-letter (long) language abbreviation (ISO 639-2/3).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsLongLanguageAbbreviation()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSame 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveLeadingAndTrailingChars()
? o1.Content()
#--> anana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSubStringComesBetween is order-INDEPENDENT (matches the original): TRUE if pcSub sits between the two bounds in EITHER order.
1 exemples exécutéso1 = new stzString("---♥♥...**---")
# '...' comes between ♥♥ and ** (in order)
? o1.SubStringComesBetween("...", "♥♥", "**")
# and order-independently between ** and ♥♥
? o1.SubStringComesBetween("...", "**", "♥♥")
#--> 1
#--> 1test de la bibliothèqueaucune extensionTRUE if pcSub occurs BEFORE pcOther (a substring, or :Position = n).
1 exemples exécutésaussi écrite: SubStringComesBeforeSubStringexemple composé
o1 = new stzString("banana split")
? o1.SubStringComesBefore("an", "an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if pcSub occurs AFTER pcOther (a substring, or :Position = n).
1 exemples exécutésaussi écrite: SubStringComesAfterSubStringexemple composé
o1 = new stzString("banana split")
? o1.SubStringComesAfter("an", "an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if pcSub occurs before the given position.
1 exemples exécutésaussi écrite: SubStringComesBeforePositionexemple composé
o1 = new stzString("banana split")
? o1.SubStringComesBeforePos("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if pcSub occurs after the given position.
1 exemples exécutésaussi écrite: SubStringComesAfterPositionexemple composé
o1 = new stzString("banana split")
? o1.SubStringComesAfterPos("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionTRUE if pcSub occurs between the two given positions.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.SubStringComesBetweenPositions("an", 2, 5)
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionInQ
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.aucune extension
SubStringQ
Open a NARRATIVE chain about the given substring (ComesBefore / ComesAfter...).aucune extension
@
@(pcSub): narrative-set the subject substring; returns self.aucune extension
@RemoveItQ
@RemoveItQ(): remove every occurrence of the narrative sub.aucune extension
AndThenQ
Narrative glue: returns the object unchanged, chainable.aucune extension
AndQ
Narrative glue: returns the object unchanged, chainable.aucune extension
SpacifyItQ
Spacify the content (chars separated by spaces), chainable.aucune extension
SpacifyItR
The R-suffixed form returns the RESULT string (not the object).
exemple composé
o1 = new stzString("banana split")
? o1.SpacifyItR()
#--> b a n a n a s p l i tcomposé à partir de la signature, exécuté pour cette page aucune extension@0
Narrative closer: the content, as data (positional form).aucune extension
ComesBeforeSubString
Narrative form: TRUE if the chain's substring comes before the given one.
exemple composé
o1 = new stzString("banana split")
? o1.ComesBeforeSubString("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionComesAfterSubString
Narrative form: TRUE if the chain's substring comes after the given one.
exemple composé
o1 = new stzString("banana split")
? o1.ComesAfterSubString("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionComesBetweenPositions
Narrative form: TRUE if the chain's substring lies between the two positions.
exemple composé
o1 = new stzString("banana split")
? o1.ComesBetweenPositions(2, 5)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionComesBeforePosition
Narrative form: TRUE if the chain's substring comes before the position.
exemple composé
o1 = new stzString("banana split")
? o1.ComesBeforePosition(2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionComesAfterPosition
Narrative form: TRUE if the chain's substring comes after the position.
exemple composé
o1 = new stzString("banana split")
? o1.ComesAfterPosition(2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionSubStringComesBetweenSubStrings
TRUE if pcSub occurs between the two given substrings.aucune extension
CharsAndTheirUnicodes
Each char paired with its codepoint (char first).
exemple composé
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 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionToListInStringNF
The content as a list literal in normal form, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.ToListInStringNF()
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]composé à partir de la signature, exécuté pour cette page aucune extensionSectionBounds
SectionBounds(n1, n2, nLeftMax, nRightMax): the [open, close] bound substrings just before n1 and just after n2.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SectionBounds(2, 5, 2, 2) )
#--> [ "b", "a " ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFirstNonSpaceChar
The first non-space char of the string.
exemple composé
o1 = new stzString("banana split")
? o1.FirstNonSpaceChar()
#--> bcomposé à partir de la signature, exécuté pour cette page aucune extensionLastNonSpaceChar
The last non-space char of the string.
exemple composé
o1 = new stzString("banana split")
? o1.LastNonSpaceChar()
#--> tcomposé à partir de la signature, exécuté pour cette page aucune extensionFirstNonSpaceCharPosition
The position of the first non-space char.
aussi écrite: FindFirstNonSpaceCharexemple composé
o1 = new stzString("banana split")
? o1.FirstNonSpaceCharPosition()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionLastNonSpaceCharPosition
The position of the last non-space char.
aussi écrite: FindLastNonSpaceCharexemple composé
o1 = new stzString("banana split")
? o1.LastNonSpaceCharPosition()
#--> 12composé à partir de la signature, exécuté pour cette page aucune extensionStringsW
Treat the content as a list of strings and filter by the W condition.aucune extension
Multiply EVERY number inside the string by n (mutating).
2 exemples exécutésaussi écrite: MultipliedByNQCSXTZZZIBWUSubtractN
Subtract n from every number inside the string (mutating).QCSXTZZZIBWU
FromUrl
URL fetch (stub: no network in this version; answers empty).aucune extension
Insert(pcSub, :BeforePosition = n / :AfterPosition = n / n).
3 exemples exécutésaussi nommée: put at position add at place into injectexemple composé
o1 = new stzString("banana split")
o1.Insert("an", 2)
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUWalkUntil
Walk the chars forward: the position where the condition first holds.
exemple composé
o1 = new stzString("banana split")
? o1.WalkUntil("@char = 'a'")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionEachCharBoxedDashed
Each char in its own dashed box cell.
exemple composé
o1 = new stzString("banana split")
? o1.EachCharBoxedDashed()
#--> ┌╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┬╌╌╌┐
#--> ┊ b ┊ a ┊ n ┊ a ┊ n ┊ a ┊ ┊ s ┊ p ┊ l ┊ i ┊ t ┊
#--> └╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┴╌╌╌┘composé à partir de la signature, exécuté pour cette page aucune extensionThe string as boxed char cells with the occurrences of pcSub visually marked (the VizFind map, boxed).
1 exemples exécutéso1 = 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 │
#--> └───┴───┴─•─┴───┴───┴───┴───┴─•─┴───┴───┴───┴───┴─•─┴───┴───┴───┴───┴───┴─•─┴───┴───┘test de la bibliothèqueQCSXTZZZIBWUVizFindBoxedRounded
The boxed VizFind map with rounded corners.aucune extension
VizFindBoxedDashed
The boxed VizFind map with dashed lines.aucune extension
VizFindManyXT2
Same as VizFindManyXT: Accept VizFindManyXT with single sub string or list.aucune extension
IsADigitInString
TRUE if the string is a single digit.
exemple composé
o1 = new stzString("banana split")
? o1.IsADigitInString()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionFindSSZ
Section-bounded find: the positions of pcSub within n1..n2.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindSSZ("an", 2, 5) )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplace the substring at each given position with its counterpart in the new list (mutating).
1 exemples exécutéso1 = new stzString("--[...]---[...]---[...]---[~~~]--[~~~]--")
o1.ReplaceSubStringAtPositionsByMany([ 27, 34 ], "[~~~]", [ "bbb", "aaa" ])
# each got its own name
? o1.Content()
#--> --[...]---[...]---[...]---bbb--aaa--test de la bibliothèqueaucune extensionToListInString(): the hosted list rendered in normal form (@@).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ToListInString()
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]composé à partir de la signature, exécuté pour cette page aucune extensionLanguageAbbreviationFor
The ISO 639-1 code for the given language name.aucune extension
LongLanguageAbbreviationFor
The 3-letter ISO 639-2/3 code for the given language name.aucune extension
SplitAroundSections
Split the string around the given sections (the sections excluded).
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAroundSections([ "an", "a" ]) )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitAroundSubStrings
Split around the occurrences of EACH given substring.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAroundSubStrings([ "an", "a" ]) )
#--> [ "b", " split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitAroundSection
Split the string around one [start, end] section.QCSXTZZZIBWU
MarquersPositionsSortedInAscending
The marquer positions in ascending order.aussi écrite: MarkersPositionsSortedInAscendingaucune extension
MarquersPositionsSortedInDescending
The marquer positions in descending order.aussi écrite: MarkersPositionsSortedInDescendingaucune extension
The position of the nth occurrence after the given position (:Of = substring form).
1 exemples exécutéso1 = 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
#--> 11test de la bibliothèqueaucune extensionAn ascending-sorted copy of the chars; the original is unchanged.
2 exemples exécutéso1 = new stzString("73964532041")
# ascending
? o1.SortedInAscending()
# descending
? o1.SortedInDescending()
#--> 01233445679
#--> 97654433210test de la bibliothèqueaucune extensionA descending-sorted copy of the chars; the original is unchanged.
2 exemples exécutéso1 = new stzString("73964532041")
# ascending
? o1.SortedInAscending()
# descending
? o1.SortedInDescending()
#--> 01233445679
#--> 97654433210test de la bibliothèqueaucune extensionTRUE if the chars are sorted, ascending OR descending.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsSorted()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe sorting order of the chars (:Ascending, :Descending, ...).
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.SortingOrder()
#--> unsortedcomposé à partir de la signature, exécuté pour cette page aucune extensionSort the CHARS of the string in ascending order in place (mutating). For a copy, use Sorted.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.Sort()
? o1.Content()
#--> aaabilnnpstcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSortInAscending
Sort the chars in ascending order in place (mutating).
exemple composé
o1 = new stzString("banana split")
o1.SortInAscending()
? o1.Content()
#--> aaabilnnpstcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSortInDescending
Sort the chars of the string in descending order in place (mutating).
exemple composé
o1 = new stzString("banana split")
o1.SortInDescending()
? o1.Content()
#--> tspnnlibaaacomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWULeadingSubStringRemove
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.aucune 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.
exemple composé
o1 = new stzString("banana split")
o1.RemoveLeadingSubString()
? o1.Content()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionA copy with the leading char run removed.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.LeadingCharsRemoved()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionTrailingCharsRemoved
A copy with the trailing char run removed.
exemple composé
o1 = new stzString("banana split")
? o1.TrailingCharsRemoved()
#--> banana splicomposé à partir de la signature, exécuté pour cette page aucune extensionRemove the first n chars (mutating).
1 exemples exécutéso1 = new stzString("123BATISTA")
o1.RemoveNFirstChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("123BATISTA").FirstNCharsRemoved(3)
#--> BATISTA
#--> BATISTAtest de la bibliothèqueQCSXTZZZIBWURemove the last n chars (mutating).
1 exemples exécutéso1 = new stzString("BATISTA123")
o1.RemoveNLastChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA123").LastNCharsRemoved(3)
#--> BATISTA
#--> BATISTAtest de la bibliothèqueQCSXTZZZIBWUBeginsWith(pcSub): TRUE iff content starts with pcSub.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.BeginsWith("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUThe position of the nth occurrence of pcSub after the given position.
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.FindNextNthOccurrence(2, "an", 5)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe position of the nth occurrence before the given position.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.NthPreviousOccurrence(2, "an", 5)
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionFindPreviousNthOccurrence(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 exemples exécutésaussi écrite: FindPreviousNthOccurrenceOfexemple composé
o1 = new stzString("banana split")
? o1.FindPreviousNthOccurrence(2, "an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe first occurrence of the substring from the given start position: the position(s).
1 exemples exécutésaussi écrite: FindFirstPreviousOccurrenceexemple composé
o1 = new stzString("banana split")
? o1.FindFirstPrevious("an", 2)
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionThe first occurrence of the substring from the given start position: the position(s).
1 exemples exécutésaussi écrite: FindFirstNextOccurrenceexemple composé
o1 = new stzString("banana split")
? o1.FindFirstNext("an", 2)
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionThe distance in chars from the given position to the target.
2 exemples exécutéso1 = new stzString("---456---")
# the exclusive gap
? o1.DistanceTo("6", :StartingAt = 4)
# the inclusive XT distance
? o1.DistanceToXT("6", :StartingAt = 4)
#--> 1
#--> 3test de la bibliothèqueQCSXTZZZIBWUSTContainsTheLetters(pacLetters): TRUE iff content contains every letter in pacLetters (in any order).
1 exemples exécutéso1 = new stzString("Adoption of the plan B")
# contains the letters N and b
? o1.ContainsTheLetters([ "N", "b" ])
#--> 1test de la bibliothèqueaucune extensionFindSubStringBetween
FindSubStringBetween(pcSub, pcOpen, pcClose): positions of pcSub inside any pcOpen..pcClose section.aucune extension
ToStzText
ToStzText() -- bridge into the text-meaning domain (base/natural/stzText).aucune extension
PartsUsing
The parts of the string partitioned by the given expression's value.
exemple composé
o1 = new stzString("banana split")
? @@( o1.PartsUsing("@char = 'a'") )
#--> [ "b", "a", "n", "a", "n", "a", " split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsNoOneOfThese(paSubStr): TRUE iff content contains NONE of the listed substrings.
1 exemples exécutésaussi écrite: ContainsNoneOfTheseo1 = new stzString("abcdef")
# none present
? o1.ContainsNoOneOfThese([ "xy", "xyz", "mwb" ])
# de spoils it
? o1.ContainsNoOneOfThese([ "xy", "xyz", "de", "mwb" ])
#--> 1
#--> 0test de la bibliothèqueaucune extensionIsLowercased / IsUppercased: predicates over content's case form.
1 exemples exécutés# tunis is lowercased
? StzStringQ("tunis").IsLowercased()
# TUNIS is uppercased
? StzStringQ("TUNIS").IsUppercased()
# Tunis is titlecased
? StzStringQ("Tunis").IsTitlecased()
#--> 1
#--> 1
#--> 1test de la bibliothèqueaucune extensionTRUE if the string is in UPPER CASE.
1 exemples exécutés# tunis is lowercased
? StzStringQ("tunis").IsLowercased()
# TUNIS is uppercased
? StzStringQ("TUNIS").IsUppercased()
# Tunis is titlecased
? StzStringQ("Tunis").IsTitlecased()
#--> 1
#--> 1
#--> 1test de la bibliothèqueaucune extension(IsLowercase / IsUppercase already exist earlier.) HasThisCentralChar(pcChar): TRUE iff the central char is pcChar.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.HasThisCentralChar("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionA copy with the last n chars removed.
1 exemples exécutésaussi écrite: NLastCharsRemovedo1 = new stzString("BATISTA123")
o1.RemoveNLastChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA123").LastNCharsRemoved(3)
#--> BATISTA
#--> BATISTAtest de la bibliothèqueaucune extensionA copy with the first n chars removed.
1 exemples exécutésaussi écrite: NFirstCharsRemovedo1 = new stzString("123BATISTA")
o1.RemoveNFirstChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("123BATISTA").FirstNCharsRemoved(3)
#--> BATISTA
#--> BATISTAtest de la bibliothèqueaucune extensionIsTitleCased: every space-separated word starts with an uppercase letter; the rest of that word is lower.
1 exemples exécutés# tunis is lowercased
? StzStringQ("tunis").IsLowercased()
# TUNIS is uppercased
? StzStringQ("TUNIS").IsUppercased()
# Tunis is titlecased
? StzStringQ("Tunis").IsTitlecased()
#--> 1
#--> 1
#--> 1test de la bibliothèqueaucune extensionContainsLetters(): TRUE iff the content contains any letter.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsLetters()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionThe chars in reverse order, as data; the original is unchanged.
2 exemples exécutésaussi nommée: backwards text mirrored reversed stringaussi écrite: Inversed# SOFTANZA backwards
? StzStringQ("SOFTANZA").CharsReversed()
# whitespace squeezed
? StzStringQ(" Softanza Near-natural Programming ").Simplified()
#--> AZNATFOS
#--> Softanza Near-natural Programmingtest de la bibliothèqueaucune extensionIsAlmostAFunctionCall(): TRUE iff content roughly matches `identifier(...)` syntax.
1 exemples exécutés# a bare call
? StzStringQ('myfunc()').IsAlmostAFunctionCall()
# a call with args
? StzStringQ('my_func("name")').IsAlmostAFunctionCall()
#--> 1
#--> 1test de la bibliothèqueaucune extensionWalkBackwardW
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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.WalkBackwardW("@char = 'a'", 2) )
#--> [ 6, 4, 2 ]composé à partir de la signature, exécuté pour cette page aucune extensionReplaceNthCharQ alias. Replace the char at position n with the given one (chainable).
1 exemples exécutés# positional
? StzStringQ("évènement").ReplaceNthCharQ(3, "*").Content()
# named
? StzStringQ("évènement").ReplaceNthCharQ(3, :With = "*").Content()
#--> év*nement
#--> év*nementtest de la bibliothèqueaucune extensionCharQ
The char at position n, wrapped as a stzChar object.aucune extension
PartsClassifiedUsing
Same as PartsClassifiedUsingXT: The parts grouped by their partitioner value: [ [value, [parts...]], ... ].
exemple composé
o1 = new stzString("banana split")
? @@( o1.PartsClassifiedUsing("@char = 'a'") )
#--> [ [ 0, [ "b", "n", "n", " split" ] ], [ 1, [ "a", "a", "a" ] ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUPartsAndPartitionersUsingXT
Each part zipped with its partitioner value (the expression's result for it).
aussi écrite: Parts2Usingexemple composé
o1 = new stzString("banana split")
? @@( o1.PartsAndPartitionersUsingXT("@char = 'a'") )
#--> [ [ "b", 0 ], [ "a", 1 ], [ "n", 0 ], [ "a", 1 ], [ "n", 0 ], [ "a", 1 ], [ " split", 0 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceAllChars(pcOld, pcNew): char-by-char map. ReplaceAllChars: (:With = pcNew) : replace every char with pcNew Two-arg (pcOld, pcNew) form lives in ReplaceAllCharsXT.
1 exemples exécutéso1 = new stzString("Use these two letters: س and ص.")
o1.ReplaceAllChars( :With = "*" )
# as many stars as chars
? o1.Content()
#--> *******************************test de la bibliothèqueQCSXTZZZIBWUHow many chars satisfy the W condition.
1 exemples exécutés# 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
#--> 4test de la bibliothèqueaucune extensionNthSubStringAfterSplittingStringUsing(n, pcSep): the n-th piece after splitting on pcSep.
1 exemples exécutéso1 = new stzString("abc;123;gafsa;ykj")
# via SplitQ
? o1.SplitQ(";").NthItem(3)
# via the long natural name
? o1.NthSubstringAfterSplittingStringUsing(3, ";")
#--> gafsa
#--> gafsatest de la bibliothèqueaucune extensionSame as ContainsEachCS: ContainsEachCS(pacSubStr, pCaseSensitive): TRUE iff content contains every listed substring.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsEach([ "an", "a" ])
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsEachOfThese
Same as ContainsEachCS: ContainsEachCS(pacSubStr, pCaseSensitive): TRUE iff content contains every listed substring.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsEachOfThese([ "an", "a" ])
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUMultiplyBy(n): repeat content n times. MultiplyBy(list): distribute -- "a" x ["b","c"] -> "ab" + "ac".
1 exemples exécutéso1 = new stzString("a")
o1.MultiplyBy([ "b", "c", "d" ])
# ab + ac + ad
? o1.Content()
#--> abacadtest de la bibliothèqueQCSXTZZZIBWUReplaceFirstNChars
ReplaceFirstNChars(n, pcNew): replace the first n chars with pcNew.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceFirstNChars(2, "AN")
? o1.Content()
#--> ANnana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceLastNChars
Replace the last n chars with the given string (mutating).
exemple composé
o1 = new stzString("banana split")
o1.ReplaceLastNChars(2, "AN")
? o1.Content()
#--> banana splANcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReplaceNthOccurrence
Replace only the nth occurrence of pcSub with pcNew (mutating).
exemple composé
o1 = new stzString("banana split")
o1.ReplaceNthOccurrence(2, "an", "AN")
? o1.Content()
#--> banANa splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveFirstOccurrence(pcSub) -- accepts :Of = pcSub.
1 exemples exécutéso1 = new stzString("LandRingoriaLand")
o1.RemoveFirstOccurrence( :Of = "Land")
# the trailing one stays
? o1.Content()
#--> RingoriaLandtest de la bibliothèqueQCSXTZZZIBWUOrientation
Orientation(): :LTR for normal scripts, :RTL when first char is Arabic/Hebrew/etc.
exemple composé
o1 = new stzString("banana split")
? o1.Orientation()
#--> ltrcomposé à partir de la signature, exécuté pour cette page aucune extensionRemoveNLeftChars / RemoveNRightChars aliases.
2 exemples exécutéso1 = new stzString("سلام لأهل مصر الكرام")
o1.RemoveNLeftChars(7)
# the head is gone, string-order
? o1.Content()
#--> هل مصر الكرامtest de la bibliothèqueQCSXTZZZIBWUSame as RemoveNLastChars: Remove the last n chars (mutating).
1 exemples exécutéso1 = new stzString("eeebxeTuniseee")
o1.RemoveNLeftChars(3)
o1.RemoveNRightChars(3)
# the middle remains
? o1.Content()
#--> bxeTunistest de la bibliothèqueQCSXTZZZIBWUReplace the occurrences of pcSub cycling through the given replacements (same as ReplaceByMany).
1 exemples exécutéso1 = new stzString("--Ring--Softanza--")
o1.ReplaceWithMany("--", [ "1", "2", "3" ])
# the three '--' get 1, 2, 3
? o1.Content()
#--> 1Ring2Softanza3test de la bibliothèqueQCSXTZZZIBWUReplace each substring with its same-index counterpart (pairwise, mutating).
1 exemples exécutéso1 = new stzString("--Ring__Softanza..")
o1.ReplaceManyWithMany([ "--", "__", ".." ], [ "1", "2", "3" ])
# -- / __ / .. become 1 / 2 / 3
? o1.Content()
#--> 1Ring2Softanza3test de la bibliothèqueQCSXTZZZIBWUAlignedXT(:Width = n, :PadChar = " ", :Direction = :Left/:Right/:Center)
1 exemples exécutés# eleven dots each side
? Q("SFOTANZA").AlignedXT( :Width = 30, :Char = ".", :Direction = :Center )
#--> ...........SFOTANZA...........test de la bibliothèqueaucune extensionCompressUsingBinary(pcMask): keep the chars whose mask bit is "1", drop the "0" ones ("ABCDEFGH" x "10011011" -> "ADEGH").
1 exemples exécutéso1 = new stzString("ABCDEFGH")
o1.CompressUsingBinary("10011011")
# the 1-bits survive
? o1.Content()
#--> ADEGHtest de la bibliothèqueQCSXTZZZIBWUSame as UnicodeCompareWithCS: UnicodeCompareWithCS(pcOther, pCaseSensitive): codepoint comparison. Returns :Less, :Equal or :Greater.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.UnicodeCompareWith("an")
#--> greatercomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWULocale-flavored Unicode comparison with the given string.
1 exemples exécutés# RESERVE beats reserve on the tie-break
? Q("RÉSERVÉ").UnicodeCompareWithInSystemLocale("réservé")
#--> greatertest de la bibliothèqueaucune extensionContainsLetter(pcLetter): TRUE iff content contains pcLetter.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.ContainsLetter("an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionContainsBoth(pcA, pcB): TRUE iff content contains BOTH.
1 exemples exécutéso1 = new stzString("ar_TN-tun")
# contains each of _ and -
? o1.ContainsEachCS([ "_", "-" ], TRUE)
# contains both
? o1.ContainsBoth("_", "-")
#--> 1
#--> 1test de la bibliothèqueaucune extensionNumericValue
NumericValue(): content as a number.aucune 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.aucune extension
IsALetterOf(pcOther): TRUE iff single-char This appears in pcOther.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsALetterOf("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionRemoveLeftOccurrence
Same as RemoveFirstOccurrence: RemoveFirstOccurrence(pcSub) -- accepts :Of = pcSub.
exemple composé
o1 = new stzString("banana split")
o1.RemoveLeftOccurrence("an")
? o1.Content()
#--> bana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUPositionAfter
PositionAfter(pcSub): position right after first occurrence.
exemple composé
o1 = new stzString("banana split")
? o1.PositionAfter("an")
#--> 4composé à partir de la signature, exécuté pour cette page aucune extensionPositionBefore
The position just BEFORE the first occurrence of pcSub.
exemple composé
o1 = new stzString("banana split")
? o1.PositionBefore("an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionInsertSubStrings(anPos, pacStr): insert pacStr[i] at anPos[i], processed from highest position down so earlier positions stay valid.
3 exemples exécutéso1 = 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!test de la bibliothèqueQCSXTZZZIBWUItemsWhere
Same as CharsW: (IsTitlecased -- Haro is case-insensitive, just one def.) CharsW(pcCondition): the characters where the predicate is TRUE (predicate-driven char filter).
exemple composé
o1 = new stzString("banana split")
? @@( o1.ItemsWhere("@char = 'a'") )
#--> [ "a", "a", "a" ]composé à partir de la signature, exécuté pour cette page aucune extensionIsShortLanguageAbbreviation(): 2-letter ISO 639-1-style alpha code.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.IsShortLanguageAbbreviation()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsLatin(): TRUE iff every char is ASCII-Latin.
1 exemples exécutés# Latin script
? StzStringQ("Ⅱ").IsLatin()
# and a Roman number
? StzCharQ("Ⅱ").IsRomanNumber()
#--> 1
#--> 1test de la bibliothèqueaucune extensionContainsNOccurrences
TRUE if pcSub occurs exactly n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsNOccurrences(2, "an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUEXTRACT the digits as one string ("number 125" -> "125").
1 exemples exécutésaussi écrite: OnlyDigits# digits only
? Q("number 12500 number 18200").OnlyNumbers()
#--> 1250018200test de la bibliothèqueaucune extensionPad the string to length n with spaces (mutating).
1 exemples exécutéso1 = new stzString("ABC")
o1.ExtendTo(5)
# it is padded to width 5 with spaces
? o1.Content()
#--> ABCtest de la bibliothèqueQCSXTZZZIBWURemove pcSub only where it is bounded by the given bounds (mutating).
1 exemples exécutéso1 = new stzString("__^^^__^^♥^^__")
o1.RemoveSubStringBoundedBy("♥", "^^")
# heart gone, carets stay
? o1.Content()
#--> __^^^__^^^^__test de la bibliothèqueQCSXTZZZIBWUSame as RemoveNFirstChars: Remove the first n chars (mutating).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveNCharsLeft(2)
? o1.Content()
#--> nana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as RemoveNLastChars: Remove the last n chars (mutating).
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveNCharsRight(2)
? o1.Content()
#--> banana splcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUBoxEachChar
Box each char in its own cell, in place (mutating).QCSXTZZZIBWU
CharsBoxed
Each char in its own box cell, as data.
exemple composé
o1 = new stzString("banana split")
? o1.CharsBoxed()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ b │ a │ n │ a │ n │ a │ │ s │ p │ l │ i │ t │
#--> └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘composé à partir de la signature, exécuté pour cette page aucune extensionBox each char in its own cell, in place (mutating).
2 exemples exécutéso1 = new stzString("SOFTANZA")
o1.BoxifyChars()
# eight cells
? o1.Content()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ S │ O │ F │ T │ A │ N │ Z │ A │
#--> └───┴───┴───┴───┴───┴───┴───┴───┘test de la bibliothèqueQCSXTZZZIBWUFindAnyBoundedByAsSectionss
Same as FindAnyBoundedByAsSections, the pair given as two args.aucune extension
ReplaceOccurrences: (pcOld, pcNew) : every-occurrence replace (anN, :Of = pcOld, :By = pcNew | listOfReplacements) : selected n-th occurrences
1 exemples exécutéso1 = new stzString("--[...]---[...]---[...]---[~~~]--[~~~]--")
o1.ReplaceOccurrences([ 2, :and = 3 ], :of = "[...]", :by = [ "ONE", :and = "TWO" ])
# first block untouched
? o1.Content()
#--> --[...]---ONE---TWO---[~~~]--[~~~]--test de la bibliothèqueQCSXTZZZIBWUFindConsecutiveSubStringsOfNChars
FindConsecutiveSubStringsOfNChars(n): the unique phase offsets that carry at least one full window (the original returns U(XT) over the per-window phase labels).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindConsecutiveSubStringsOfNChars(2) )
#--> [ 1, 2 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUStringCase(): return :Lowercase, :Uppercase, :TitleCase, or :Mixed.
2 exemples exécutés# its script reads latin
? TQ("ı").Script()
# it is lowercase
? Q("ı").StringCase()
# its dotted capital is uppercase
? Q("İ").StringCase()
#--> latin
#--> lowercase
#--> uppercasetest de la bibliothèqueaucune extensionFindBoundedBy
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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindBoundedBy([ "an", "a" ]) )
#--> [ 4, 6 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as IsBoundedByCS: IsBoundedByCS / IsBoundedBy: predicate. True iff the content starts with pacBounds[1] AND ends with pacBounds[2].
6 exemples exécutés# braced
? StzStringQ("{nnnnn}").IsBoundedBy([ "{", "}" ])
o1 = new stzString("بسم الله الرّحمن الرّحيم")
# opens with bism, closes with arrahim
? o1.IsBoundedBy([ "بسم", "الرّحيم" ])
#--> 1
#--> 1test de la bibliothèqueQCSXTZZZIBWUFindDuplicatesAsSections
(sans commentaire dans la source : le nom se lit comme une phrase) find duplicates as sectionsdans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? @@( o1.FindDuplicatesAsSections() )
#--> [ [ 4, 4 ], [ 4, 5 ], [ 4, 6 ], [ 5, 5 ], [ 5, 6 ], [ 6, 6 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU (sans commentaire dans la source : le nom se lit comme une phrase) find chars w 4 exemples exécutésdans la section finder delegations (expanded)# FindCharsW reports the positions of "I"
? @@( Q("KALIDIA").FindCharsW('@char = "I"') )
#--> [ 4, 6 ]test de la bibliothèqueQCSXTZZZIBWU CharsBetween
The chars between the two given positions, as a list.
exemple composé
o1 = new stzString("banana split")
? o1.CharsBetween(2, 5)
#--> nacomposé à partir de la signature, exécuté pour cette page aucune extensionFindFirstRegex
(sans commentaire dans la source : le nom se lit comme une phrase) find first regexaussi écrite: FindRegexdans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? o1.FindFirstRegex("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU FindAllRegex
(sans commentaire dans la source : le nom se lit comme une phrase) find all regexaussi écrite: FindAllRegexMatchesdans la section finder delegations (expanded)exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAllRegex("an") )
#--> [ 2, 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU 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.
exemple composé
o1 = new stzString("banana split")
? o1.CountSubStrings("an")
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionSame as CountCS: How many times the given substring occurs.
5 exemples exécutésaussi écrite: NumberOfOccurrencesexemple composé
o1 = new stzString("banana split")
? o1.Count("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUCountOverlapping
Same as CountOverlappingCS: How many times it occurs, counting OVERLAPPING matches.
exemple composé
o1 = new stzString("banana split")
? o1.CountOverlapping("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUCountLeadingChar
count leading / trailing char
exemple composé
o1 = new stzString("banana split")
? o1.CountLeadingChar("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionCountTrailingChar
count leading / trailing char
exemple composé
o1 = new stzString("banana split")
? o1.CountTrailingChar("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionCountRegex
How many matches of the given regex pattern.
exemple composé
o1 = new stzString("banana split")
? o1.CountRegex("an")
#--> 2composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsEither
IsEither(a, :Or = b): TRUE when the content equals either value (string-side override; unwraps the :Or named param).
exemple composé
o1 = new stzString("banana split")
? o1.IsEither(3, 4)
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUsplit at -- dispatcher (case-sensitive by default)
2 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAt(" ") )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitBefore
Same as SplitBeforeCS: Split the string before each occurrence of the separator (it starts each new part).
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitBefore("an") )
#--> [ "b", "an", "ana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitBefore positions / char- or substring-predicate variants.
2 exemples exécutés# the pieces start at 4 and 8
? @@( Q("---4---8---").SplitBeforePositions([ 4, 8 ]) )
#--> [ "---", "4---", "8---" ]test de la bibliothèqueaucune extensionSplit so each given position ENDS a piece.
1 exemples exécutés# the pieces end at 4 and 8
? @@( Q("---4---8---").SplitAfterPositions([ 4, 8 ]) )
#--> [ "---4", "---8", "---" ]test de la bibliothèqueaucune extensionSplitBeforeCharsW(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 exemples exécutés# SplitBeforeCharsW at the uppercase letters yields the words
? @@( Q("NoWomanNoCry").SplitBeforeCharsW('Q(@char).IsUppercase()') )
#--> [ "No", "Woman", "No", "Cry" ]test de la bibliothèqueaucune extensionSplitAfterCharsW
Split after each char satisfying the W condition.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAfterCharsW("@char = 'a'") )
#--> [ "ba", "na", "na", " split" ]composé à partir de la signature, exécuté pour cette page aucune extensionSplitBeforeSubStringsW
SplitBeforeSubStringsW(pcCondition): split before each substring matching the predicate. Engine-backed (see _SubStringMatchPositions), no eval(). Replaces the retired SplitBeforeSubStringsWXT.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitBeforeSubStringsW("@char = 'a'") )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionSplitAfterSubStringsW
Split after each substring matching the W condition.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAfterSubStringsW("@char = 'a'") )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionSplitAtSubStringsW
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().
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAtSubStringsW("@char = 'a'") )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFSplitAfter
Same as SplitAfterCS: Split the string after each occurrence of the separator (the separator stays with its part).
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAfter("an") )
#--> [ "ban", "an", "a split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitAround
Same as SplitAroundCS: The pieces between the occurrences of pcSubStr (codepoint-aware).
aussi écrite: SplitAroundSubStringexemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAround("an") )
#--> [ "b", "", "a split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUPartition
The [before, match, after] triple around the FIRST occurrence.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Partition("an") )
#--> [ "b", "an", "ana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionRPartition
The [before, match, after] triple around the LAST occurrence.
exemple composé
o1 = new stzString("banana split")
? @@( o1.RPartition("an") )
#--> [ "ban", "an", "a split" ]composé à partir de la signature, exécuté pour cette page aucune extensionSplitByRegex
Split the string on the matches of the given regex pattern.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitByRegex("an") )
#--> [ "b", "", "a split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSplitAtPosition
Split the string at the given position.
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAtPosition(2) )
#--> [ "b", "nana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionSplitAtPositions
Split the string at the given positions.aucune extension
InsertBeforeSubString
Same as InsertBeforeSubStringCS: inserting before / after all occurrences
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeSubString("an", "an")
? o1.Content()
#--> banananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertAfterSubString
Same as InsertAfterSubStringCS: inserting before / after all occurrences
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterSubString("an", "an")
? o1.Content()
#--> banananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertBeforeFirst
Same as InsertBeforeFirstCS: inserting before first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeFirst("an", "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertAfterFirst
Same as InsertAfterFirstCS: inserting after first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterFirst("an", "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertBeforeLast
Same as InsertBeforeLastCS: inserting before first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeLast("an", "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertAfterLast
Same as InsertAfterLastCS: inserting after first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterLast("an", "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertBeforeNth
Same as InsertBeforeNthCS: inserting before nth occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeNth(2, "an", "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUInsertAfterNth
Same as InsertAfterNthCS: inserting after nth occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterNth(2, "an", "an")
? o1.Content()
#--> bananana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveCharAt
Same as RemoveSection: Remove the chars at positions n1..n2 (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveCharAt(2)
? o1.Content()
#--> bnana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionRemoveAtPosition
Same as RemoveSection: Remove the chars at positions n1..n2 (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveAtPosition(2)
? o1.Content()
#--> bnana splitcomposé à partir de la signature, exécuté pour cette page aucune extensionRemoveSpaces
Remove all the spaces (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveSpaces()
? o1.Content()
#--> bananasplitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveSpacesInSections
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.aucune extension
RemoveTrailingSpaces
Same as TrimRight: Remove the trailing spaces in place (mutating). For a copy, use TrimmedRight.aucune extension
WithoutSpaces / SpacesRemoved: return the content with every space character removed, without mutating This. Ported from archive line 89601-89614.
1 exemples exécutésaussi écrite: WithoutSapces · WithoutSpacesexemple composé
o1 = new stzString("banana split")
? o1.SpacesRemoved()
#--> bananasplitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame 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 exemples exécutésaussi écrite: TheseSpacified · TheseSubstringsSpacifiedo1 = new stzString("iloveringprogramminglanguage")
? o1.TheseSubStringsSpacified([ "php", "ruby" ]) # Nothing happens because these substrings
#--> iloveringprogramminglanguagetest de la bibliothèqueQCSXTZZZIBWUSame 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 exemples exécutéso1 = new stzString("whatisyournameplease?")
o1.SpacifySubStringsUsing(["is", "your", "name"], "_")
? o1.Content()
#--> what_is_your_name_please?test de la bibliothèqueQCSXTZZZIBWUSpacifySubStringUsing
Separate the chars of pcSub inside the string with the given separator (mutating).aucune extension
SpacifySubStrings
Spacify every occurrence of the given substrings (mutating).aucune extension
AddXT(cBoth, :Around = "p") Shortcut for [cBoth, cBoth] -- same separator on both sides.
14 exemples exécutéso1 = new stzString("__♥__♥__♥__")
o1.AddXT(" ", :AroundEach = "♥")
# every heart breathes
? o1.Content()
#--> __ ♥ __ ♥ __ ♥ __test de la bibliothèqueQCSXTZZZIBWUFindAnySubStringBoundedByZZ
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnySubStringBoundedByZZ([ "an", "a" ]) )
#--> [ [ 4, 3 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionFindAnySubStringsBoundedByZZ
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnySubStringsBoundedByZZ([ "an", "a" ]) )
#--> [ [ 4, 3 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionRemoveThisTrailingChar: 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 exemples exécutéso1 = new stzString("12.4560000")
o1.RemoveThisTrailingChar("0")
# mutated in place
? o1.Content()
# or functionally
? Q("12.45600").ThisTrailingCharRemoved("0")
#--> 12.456
#--> 12.456test de la bibliothèqueQCSXTZZZIBWUA copy with the trailing run of the given char removed.
1 exemples exécutéso1 = new stzString("12.4560000")
o1.RemoveThisTrailingChar("0")
# mutated in place
? o1.Content()
# or functionally
? Q("12.45600").ThisTrailingCharRemoved("0")
#--> 12.456
#--> 12.456test de la bibliothèqueaucune extensionThisLeadingCharRemoved
A copy with the leading run of the given char removed.aucune 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 exemples exécutéso1 = new stzString("000122.12")
# the leading char
? o1.LeadingChar()
o1.RemoveThisLeadingChar("0")
# the run is gone
? o1.Content()
#--> 0
#--> 122.12test de la bibliothèqueQCSXTZZZIBWURemoveDuplicates
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 exemples exécutéso1 = new stzString("let's say welcome to everyone!")
o1.RemoveFromLeft("let's say ")
# the lead is gone
? o1.Content()
#--> welcome to everyone!test de la bibliothèqueQCSXTZZZIBWUSame as RemoveFromRightCS: Remove pcSubStr from the visual RIGHT end (direction-aware, mutating).
1 exemples exécutéso1 = new stzString("هذه الكلمات الّتي سوف تبقى")
# the right 4 chars open the text
? o1.NRightCharsAsSubstring(4)
o1.RemoveFromRight("هذه ")
# removing from the right trims the start
? o1.Content()
#--> هذه
#--> الكلمات الّتي سوف تبقىtest de la bibliothèqueQCSXTZZZIBWURemove nRange chars starting at nStart (mutating).
1 exemples exécutéso1 = new stzString("extrasection")
o1.RemoveRange(1, 5)
# range removed
? o1.Content()
#--> sectiontest de la bibliothèqueaucune extensionFindDuplicates
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).
aussi écrite: DuplicationsZ · DuplicateCharsZexemple composé
o1 = new stzString("banana split")
? @@( o1.FindDuplicates() )
#--> [ 4, 5, 6 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame 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 exemples exécutésaussi écrite: DupSecutiveCharsZoA = 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
#--> 999test de la bibliothèqueQCSXTZZZIBWUSame 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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.FindDupSecutiveSubString("an") )
#--> [ 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUDupSecutiveSubStringZ
DupSecutiveSubStringZ(sub): the substring grouped with the positions of its consecutive-duplicate occurrences.
exemple composé
o1 = new stzString("banana split")
? @@( o1.DupSecutiveSubStringZ("an") )
#--> [ "an", [ 4 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUDupSecutiveSubStrings
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.DupSecutiveSubStrings() )
#--> [ "na", "an" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUFindDupSecutiveSubStrings
(sans commentaire dans la source : le nom se lit comme une phrase) find dup secutive sub stringsdans la section find first starting atexemple composé
o1 = new stzString("banana split")
? @@( o1.FindDupSecutiveSubStrings() )
#--> [ 5, 4 ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU RemoveDupSecutiveSubStrings
(sans commentaire dans la source : le nom se lit comme une phrase) remove dup secutive sub stringsdans la section find first starting atexemple composé
o1 = new stzString("banana split")
o1.RemoveDupSecutiveSubStrings()
? o1.Content()
#--> ban splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWU DupSecutiveSubStringsRemoved
(sans commentaire dans la source : le nom se lit comme une phrase) dup secutive sub strings removeddans la section find first starting atexemple composé
o1 = new stzString("banana split")
? o1.DupSecutiveSubStringsRemoved()
#--> ban splitcomposé à partir de la signature, exécuté pour cette page aucune 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 exemples exécutésaussi écrite: ContainsAtPositions# hearts sit at 2, 5, 8
? Q("^♥^^♥^^♥^").ContainsAtPositions([ 2, 5, 8 ], "♥")
# a heart sits at position 1
? Q("♥^^♥^^♥").ContainsAtPosition("♥", 1)
#--> 1
#--> 1test de la bibliothèqueaucune extension(sans commentaire dans la source : le nom se lit comme une phrase) contains at position 1 exemples exécutésdans la 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
#--> 1test de la bibliothèqueaucune extension Letters
Letters() / LettersQ(): characters that are letters. Engine- backed: filters the codepoint list by IsLetter() (Unicode-aware).
exemple composé
o1 = new stzString("banana split")
? @@( o1.Letters() )
#--> [ "b", "a", "n", "a", "n", "a", "s", "p", "l", "i", "t" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUNumberOfLetters
(sans commentaire dans la source : le nom se lit comme une phrase) number of lettersdans la section find first starting atexemple composé
o1 = new stzString("banana split")
? o1.NumberOfLetters()
#--> 11composé à partir de la signature, exécuté pour cette page aucune 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 exemples exécutés# the plural kind
? Q("①②③").AllCharsAre(:CircledNumbers)
# the XT list of kinds
? Q("①②③").AllCharsAreXT([:CircledNumber, :Chars], [])
#--> 1
#--> 1test de la bibliothèqueQCSXTZZZIBWUIsPluralOfAStzType: predicate checking a :stz<Type>s symbolic name (e.g. :stzListsOfStrings, :stzStrings). Used by narratives that introspect Softanza type symbols.
1 exemples exécutésaussi écrite: IsPluralOfStzType# stzchars is a plural of a stz type
? Q("stzchars").IsPluralOfAStzType()
# ... specifically of stzchar
? Q("stzchars").IsPluralOfThisStzType("stzchar")
#--> 1
#--> 1test de la bibliothèqueaucune extensionAllCharsAreEven
AllCharsAre extension: :Even / :Odd / :Positive for digits. Augment the existing kind list via inline checks.
exemple composé
o1 = new stzString("banana split")
? o1.AllCharsAreEven()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionAllCharsAreOdd
(sans commentaire dans la source : le nom se lit comme une phrase) all chars are odddans la section find first starting atexemple composé
o1 = new stzString("banana split")
? o1.AllCharsAreOdd()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension AllCharsArePositive
(sans commentaire dans la source : le nom se lit comme une phrase) all chars are positivedans la section find first starting atexemple composé
o1 = new stzString("banana split")
? o1.AllCharsArePositive()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension IsNotEqualTo
TRUE if the content differs from the given string. (case-sensitive by default)
exemple composé
o1 = new stzString("banana split")
? o1.IsNotEqualTo("an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUIsLessThan
TRUE if the string sorts BEFORE the given one.
exemple composé
o1 = new stzString("banana split")
? o1.IsLessThan("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsGreaterThan
TRUE if the string sorts AFTER the given one.
exemple composé
o1 = new stzString("banana split")
? o1.IsGreaterThan("an")
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionLevenshteinDistanceWith
The Levenshtein edit distance to the given string.
aussi écrite: EditDistanceWithexemple composé
o1 = new stzString("banana split")
? o1.LevenshteinDistanceWith("an")
#--> 10composé à partir de la signature, exécuté pour cette page aucune extensionCommonPrefixWith
Same as CommonPrefixWithCS: common prefix / suffixQCSXTZZZIBWU
CommonSuffixWith
Same as CommonSuffixWithCS: common prefix / suffixQCSXTZZZIBWU
DiffWith
The differences between the string and the given one.
exemple composé
o1 = new stzString("banana split")
? @@( o1.DiffWith("an") )
#--> [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]composé à partir de la signature, exécuté pour cette page aucune extensionJaroSimilarityWith
jaro / jaro-winkler similarity
exemple composé
o1 = new stzString("banana split")
? o1.JaroSimilarityWith("an")
#--> 722composé à partir de la signature, exécuté pour cette page aucune extensionJaroWinklerSimilarityWith
jaro / jaro-winkler similarity
exemple composé
o1 = new stzString("banana split")
? o1.JaroWinklerSimilarityWith("an")
#--> 722composé à partir de la signature, exécuté pour cette page aucune extensionSoundex
The Soundex phonetic code of the string.
exemple composé
o1 = new stzString("banana split")
? o1.Soundex()
#--> B521composé à partir de la signature, exécuté pour cette page aucune extensionThe (dominant) script of the string.
2 exemples exécutés# Inherited
? StzStringQ(" 4 " + ArabicDhammah() + " ").Script()
#--> inheritedtest de la bibliothèqueaucune extensionScripts
The scripts used in the string.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Scripts() )
#--> [ "latin", "common" ]composé à partir de la signature, exécuté pour cette page aucune extensionNumberOfScripts
How many scripts the string uses.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfScripts()
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionIsScriptOfText
callable on the stzString that TQ()/StzTextQ()/QQ() return)
exemple composé
o1 = new stzString("banana split")
? o1.IsScriptOfText("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsLatinScript
TRUE if the string is written in the Latin script.
exemple composé
o1 = new stzString("banana split")
? o1.IsLatinScript()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionIsArabicScript
TRUE if the string is written in the Arabic script.
aussi écrite: IsArabicexemple composé
o1 = new stzString("banana split")
? o1.IsArabicScript()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsHanScript
TRUE if the string is written in the Han script.
exemple composé
o1 = new stzString("banana split")
? o1.IsHanScript()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsHybridScript
TRUE if the string mixes several scripts.
exemple composé
o1 = new stzString("banana split")
? o1.IsHybridScript()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCommonScript
TRUE if the chars belong to the Common script.
exemple composé
o1 = new stzString("banana split")
? o1.IsCommonScript()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsInheritedScript
TRUE if the chars belong to the Inherited script.
exemple composé
o1 = new stzString("banana split")
? o1.IsInheritedScript()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionNthWord
The nth word of the text.
exemple composé
o1 = new stzString("banana split")
? o1.NthWord(2)
#--> splitcomposé à partir de la signature, exécuté pour cette page aucune extensionFirstWord
The first word of the string.
exemple composé
o1 = new stzString("banana split")
? o1.FirstWord()
#--> bananacomposé à partir de la signature, exécuté pour cette page aucune extensionLastWord
The last word of the string.
exemple composé
o1 = new stzString("banana split")
? o1.LastWord()
#--> splitcomposé à partir de la signature, exécuté pour cette page aucune extensionUniqueWords
Same as UniqueWordsCS: The unique words of the string.
exemple composé
o1 = new stzString("banana split")
? @@( o1.UniqueWords() )
#--> [ "banana", "split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUContainsWord
Same as ContainsWordCS: TRUE if the string contains the given WORD (word-boundary aware).
exemple composé
o1 = new stzString("banana split")
? o1.ContainsWord("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUReverseWords
Reverse the ORDER of the words in place (mutating).
exemple composé
o1 = new stzString("banana split")
o1.ReverseWords()
? o1.Content()
#--> split bananacomposé à partir de la signature, exécuté pour cette page aucune extensionSortWords
Same as SortWordsCS: Sort the words in place (mutating).QCSXTZZZIBWU
WordFrequency
Each word paired with its frequency.
exemple composé
o1 = new stzString("banana split")
? o1.WordFrequency("an")
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionMostFrequentWord
The word that occurs most often in the string.
exemple composé
o1 = new stzString("banana split")
? o1.MostFrequentWord()
#--> bananacomposé à partir de la signature, exécuté pour cette page aucune extensionMostFrequentWords
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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.MostFrequentWords(2) )
#--> [ [ "banana", 1 ], [ "split", 1 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionWordsAndTheirCounts
[[word, count], ...] for every distinct word (first-appearance order).
exemple composé
o1 = new stzString("banana split")
? @@( o1.WordsAndTheirCounts() )
#--> [ [ "banana", 1 ], [ "split", 1 ] ]composé à partir de la signature, exécuté pour cette page aucune extensionCharsAndTheirCounts
Same as CharsAndTheirCountsCS: [[char, count], ...] for every distinct character (first-appearance order).
exemple composé
o1 = new stzString("banana split")
? @@( o1.CharsAndTheirCounts() )
#--> [ [ "b", 1 ], [ "a", 3 ], [ "n", 2 ], [ " ", 1 ], [ "s", 1 ], [ "p", 1 ], [ "l", 1 ], [ "i", 1 ], [ "t", 1 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUMostFrequentChars
Same as MostFrequentCharsCS: The top-N most frequent characters as [[char, count], ...] (count desc).
exemple composé
o1 = new stzString("banana split")
? @@( o1.MostFrequentChars(2) )
#--> [ [ "a", 3 ], [ "n", 2 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUMostFrequentChar
The char that occurs most often in the string.
exemple composé
o1 = new stzString("banana split")
? o1.MostFrequentChar()
#--> acomposé à partir de la signature, exécuté pour cette page aucune extensionNGramsAndTheirCounts
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).
exemple composé
o1 = new stzString("banana split")
? @@( o1.NGramsAndTheirCounts(2) )
#--> [ [ "banana split", 1 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUMostFrequentNGrams
Same as MostFrequentNGramsCS: The top-N most frequent n-grams as [[ngram, count], ...] (count desc).
exemple composé
o1 = new stzString("banana split")
? @@( o1.MostFrequentNGrams(2, 5) )
#--> [ [ "banana split", 1 ] ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUCollocations
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.
exemple composé
o1 = new stzString("banana split")
? @@( o1.MostSignificantCollocations(2) )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionCosineSimilarityWith
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.)
aussi écrite: SimilarityWithexemple composé
o1 = new stzString("banana split")
? o1.CosineSimilarityWith("an")
#--> 0composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUAverageWordsPerSentence
Sentence = text up to each . ! ? terminator. All engine-direct, no materialization: averages come from cached engine counts; the extremes from one segmenting pass.
exemple composé
o1 = new stzString("banana split")
? o1.AverageWordsPerSentence()
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionAverageCharsPerSentence
The average number of chars per sentence.
exemple composé
o1 = new stzString("banana split")
? o1.AverageCharsPerSentence()
#--> 12composé à partir de la signature, exécuté pour cette page aucune extensionLongestSentenceInWords
The word count of the longest sentence.
exemple composé
o1 = new stzString("banana split")
? o1.LongestSentenceInWords()
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionShortestSentenceInWords
The word count of the shortest sentence.
exemple composé
o1 = new stzString("banana split")
? o1.ShortestSentenceInWords()
#--> 2composé à partir de la signature, exécuté pour cette page aucune extensionHow many sentences the string holds.
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
? o1.NumberOfSentences()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionUAX#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 exemples exécutésexemple composé
o1 = new stzString("banana split")
? @@( o1.Sentences() )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUQQQQQFirstSentence
The first sentence of the string.aucune extension
LastSentence
The last sentence of the string.aucune extension
NumberOfParagraphs
How many paragraphs the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfParagraphs()
#--> 1composé à partir de la signature, exécuté pour cette page aucune extensionParagraphs
The paragraphs of the string, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.Paragraphs() )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page aucune extensionNthParagraph
The nth paragraph of the string.aucune extension
Collapse the whitespace runs to single spaces (mutating).
2 exemples exécutéso1 = new stzString(" lots of whitespace ")
# edges trimmed
? o1.Trimmed()
# then squeezed and shouted
? o1.SimplifyQ().Uppercased()
#--> lots of whitespace
#--> LOTS OF WHITESPACEtest de la bibliothèqueQCSXTZZZIBWUExceptA copy with the whitespace collapsed to single spaces; the original is unchanged.
2 exemples exécutés? StzStringQ("ab [] cd").Simplified()
? Q(list2code([ "a", [ [] ], "b" ])).Simplified()
#--> ab [] cd
#--> [ "a", [ [ ] ], "b" ]test de la bibliothèqueaucune extensionToSlug
The string turned into a URL slug (lowercase, hyphens).
exemple composé
o1 = new stzString("banana split")
? o1.ToSlug()
#--> banana-splitcomposé à partir de la signature, exécuté pour cette page aucune extensionInitials
The initial letter of each word.
exemple composé
o1 = new stzString("banana split")
? o1.Initials()
#--> bscomposé à partir de la signature, exécuté pour cette page aucune extensionToHex
The string's bytes in hexadecimal form.
exemple composé
o1 = new stzString("banana split")
? o1.ToHex()
#--> 62616e616e612073706c6974composé à partir de la signature, exécuté pour cette page aucune extensionFromHex
Set the content from its hex form (mutating).aucune extension
UrlEncoded
The string URL-encoded.aucune extension
UrlEncode
URL-encode the content in place (mutating).QCSXTZZZIBWU
UrlDecoded
The string URL-decoded.aucune 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 ' -> ') in one pass, and the bridge now sizes its buffer to fit rather than silently returning "" past 64 KB.aucune extension
HtmlEncode
HTML-encode the content in place (mutating).aucune 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 ' 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.aucune extension
HtmlDecode
HTML-decode the content in place (mutating).aucune extension
ToBinary
The string's bytes in binary form.
exemple composé
o1 = new stzString("banana split")
? o1.ToBinary()
#--> 01100010 01100001 01101110 01100001 01101110 01100001 00100000 01110011 01110000 01101100 01101001 01110100composé à partir de la signature, exécuté pour cette page aucune extensionToOctal
The string's bytes in octal form.
exemple composé
o1 = new stzString("banana split")
? o1.ToOctal()
#--> 142 141 156 141 156 141 040 163 160 154 151 164composé à partir de la signature, exécuté pour cette page aucune extensionEscapedForRegex
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.aucune extension
EscapeForRegex
Escape the regex special chars in place (mutating).aucune extension
NormalizeNFC
Normalize the content to Unicode NFC in place (mutating).aucune extension
NormalizedNFC
The string in Unicode NFC normal form.aucune extension
NormalizeNFD
Normalize the content to Unicode NFD in place (mutating).aucune extension
NormalizedNFD
The string in Unicode NFD normal form.aucune extension
NormalizeNFKC
Normalize the content to Unicode NFKC in place (mutating).aucune extension
NormalizedNFKC
The string in Unicode NFKC normal form.aucune extension
NormalizeNFKD
Normalize the content to Unicode NFKD in place (mutating).aucune extension
NormalizedNFKD
The string in Unicode NFKD normal form.aucune extension
The string in Title Case (each word capitalized).
1 exemples exécutés# lowercased
? Q("tunis").Lowercased()
# uppercased
? Q("tunis").Uppercased()
# titlecased
? Q("tunis").Titlecased()
#--> tunis
#--> TUNIS
#--> Tunistest de la bibliothèqueaucune extensionApplyTitlecase
Titlecase the content in place (mutating).QCSXTZZZIBWU
CaseFolded
The string case-folded (aggressive lowercasing, for caseless comparison).aucune extension
LeftAlignXT
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).aucune extension
RightAlignXT
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).aucune extension
CenterAlignXT
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).aucune extension
LeftAligned
A copy aligned LEFT in a field of nWidth chars.aucune extension
RightAligned
A copy aligned RIGHT in a field of nWidth chars.aucune extension
CenterAligned
A copy CENTERED in a field of nWidth chars.aucune extension
PadLeft
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).aucune extension
PadRight
Same as AlignXT: Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).aucune extension
PaddedLeft
A copy padded on the left to nWidth with the given char.aussi nommée: pad on the left right-align fill to width left-padaucune extension
PaddedRight
A copy padded on the right to nWidth with the given char.aucune 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 exemples exécutéso1 = new stzString("exeeeeeTUNIS")
# no repeated leading char
? o1.RepeatedLeadingChar()
# empty list
? len( o1.RepeatedLeadingChars() )
#--> 0test de la bibliothèqueQCSXTZZZIBWURepeatedTrailingChars
Same as RepeatedTrailingCharsCS: The trailing repeated-char run, as a list (case dial).QCSXTZZZIBWU
Same as RemoveRepeatedLeadingCharsCS: ensure prefix / suffix
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveRepeatedLeadingChars()
? o1.Content()
#--> anana splitcomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as RemoveRepeatedTrailingCharsCS: ensure prefix / suffix
1 exemples exécutésexemple composé
o1 = new stzString("banana split")
o1.RemoveRepeatedTrailingChars()
? o1.Content()
#--> banana splicomposé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUEnsurePrefix
Same as EnsurePrefixCS: ensure prefix / suffixQCSXTZZZIBWU
EnsureSuffix
Same as EnsureSuffixCS: ensure prefix / suffixQCSXTZZZIBWU
Remove pcSuffix from the end of the string when it ends with it (mutating).
2 exemples exécutéso1 = new stzString("programming*")
o1.RemoveFromEnd("*")
# bare word
? o1.Content()
#--> programmingtest de la bibliothèqueQCSXTZZZIBWURemovedFromEnd
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.aucune extension
FirstLine
Same as NthLine: The nth line of the string.aucune extension
LastLine
The last line of the string.aucune extension
UniqueLines
Same as UniqueLinesCS: The unique lines of the string.
exemple composé
o1 = new stzString("banana split")
? @@( o1.UniqueLines() )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSortLines
Same as SortLinesCS: Sort the lines in place (mutating).QCSXTZZZIBWU
RemoveBlankLines
Remove the blank lines (mutating).aucune extension
LinesContaining
Same as LinesContainingCS: The lines containing the given substring.
exemple composé
o1 = new stzString("banana split")
? @@( o1.LinesContaining("an") )
#--> [ "banana split" ]composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWUSame as TrimCharCS: trimming a specific char
1 exemples exécutéso1 = new stzString("♥♥♥123♥♥♥")
o1.TrimChar("♥")
# bare digits
? o1.Content()
#--> 123test de la bibliothèqueQCSXTZZZIBWUTrimLeftChar
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.
exemple composé
o1 = new stzString("banana split")
? o1.IsNeither("an", "an")
#--> 1composé à partir de la signature, exécuté pour cette page QCSXTZZZIBWURemoveAnyCharFromLeft/Right: strip the whole leading/trailing run -- of a given char (aliases of RemoveCharFromLeft/Right).
1 exemples exécutésaucune extensionSame as RemoveCharFromRight: Drop the trailing chars matching pcChar from the end of the string (mutating).
1 exemples exécutésaucune extensionEach Softanza class overrides StzType() to report its own type -- (the base stzObject returns :stzObject). Restored for stzString.
4 exemples exécutés? 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 ->
#--> ...test de la bibliothèqueaucune extensionIsLanguageIdentifier
Locale identifier predicates (thin OR-combinators over the existing -- name/abbreviation/number locale checks). Used by stzList's -- IsLocaleList / IsMultilingualString.
exemple composé
o1 = new stzString("banana split")
? o1.IsLanguageIdentifier()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsScriptIdentifier
TRUE if the string identifies a script (number, code or abbreviation).
exemple composé
o1 = new stzString("banana split")
? o1.IsScriptIdentifier()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsCountryIdentifier
TRUE if the string identifies a country (number, code, name...).
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryIdentifier()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extensionIsLanguageNameOrAbbreviation
TRUE if the string is a language name or abbreviation.
exemple composé
o1 = new stzString("banana split")
? o1.IsLanguageNameOrAbbreviation()
#--> 0composé à partir de la signature, exécuté pour cette page aucune extension