Softanza
DémarrerEnglish
Softanza
La bibliothèque se documente elle-même · Chaînes de caractères

stzString

1118 méthodes propres · 756 formes avec extensions, rangées sous leur méthode

la source: base/string/stzString.ring(s'ouvre dans un nouvel onglet) · Toutes les classes · La référence du domaine : Chaînes de caractères

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 string
o1 = new stzList([ 1, 2, 3 ])
? @@( o1 + Q(4) + 5 )
? @@( (o1 + Q("X" : "Z")).content() )
#--> [ 1, 2, 3, 4, 5 ]
#--> [ 1, 2, 3, [ "X", "Y", "Z" ] ]
test de la bibliothèqueQCSXTZZZIBWU
InfereType
Infer the canonical Softanza type named by this string. Used by the global InfereType(cType). Scalars collapse to :Number/:String/:Char (Stz-prefixed to :StzNumber/...); non-stz list/pair types collapse to the generic :List; stz-prefixed list types keep their (de-pluralised) canonical name (e.g. StzListsOfNumbers -> :StzListOfNumbers). Delegates to a file-scope helper: inside this class StartsWith / StzFind / StzReplaceCS resolve to stzString METHODS (wrong arity -> R20); at file scope they resolve to the global funcs.
exemple composé
o1 = new stzString("banana split")
? o1.InfereType()
#--> unknown
composé à partir de la signature, exécuté pour cette page
aucune extension
Show
Show -- print the content to stdout (terminated by NL). Convenience alias used by narrative tests of the form `o.Show()` instead of `? o.Content()`.QCSXTZZZIBWU
Display
Same as Show: print the content to stdout (terminated by NL). Convenience alias used by narrative tests of the form `o.Show()` instead of `? o.Content()`.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: Length
ostr = new stzString("s㊱m")
? ostr.NumberOfChars()
? ostr[2]
#--> 3
#--> ㊱
test de la bibliothèqueQCSXTZZZIBWU
HasMoreCharsThan
(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)
#--> 1
composé à 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)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasSameNumberOfCharsAs
(sans commentaire dans la source : le nom se lit comme une phrase) has same number of chars asaussi écrite: HasAsManyCharsAsdans la section comparing size (number of chars)
exemple composé
o1 = new stzString("banana split")
? o1.HasSameNumberOfCharsAs(3)
#--> 0
composé à 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 empty
exemple composé
o1 = new stzString("banana split")
? o1.IsEmpty()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsAChar
TRUE if the string is exactly one char long.aussi écrite: IsChar
exemple composé
o1 = new stzString("banana split")
? o1.IsChar()
#--> 0
composé à 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 extension
getting a copy of the string object 2 exemples exécutés
o2 = new stzString("R I N G")
# Copy().ReplaceQ() returns the changed copy
? o2.Copy().ReplaceQ(" ", "-").Content()
# the original is unchanged
? o2.Content()
#--> R-I-N-G
#--> R I N G
test de la bibliothèqueaucune extension
Update
updating the string content
exemple composé
o1 = new stzString("banana split")
o1.Update("AN")
? o1.Content()
#--> AN
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
updating the string content 1 exemples exécutésQCSXTZZZIBWU
updating the string content 1 exemples exécutésQCSXTZZZIBWU
UndoStack
updating the string contentaucune extension
NthChar
The char at position n (codepoint-aware).aussi écrite: CharAt
exemple composé
o1 = new stzString("banana split")
? o1.NthChar(2)
#--> a
composé à partir de la signature, exécuté pour cette page
aucune extension
The first char of the string (codepoint-aware). 2 exemples exécutésaussi nommée: first character initial leading character opening charaussi écrite: LeftChar
o1 = new stzString("ABC")
# first
? o1.FirstChar()
# last
? o1.LastChar()
#--> A
#--> C
test de la bibliothèqueQCSXTZZZIBWU
The last char of the string (codepoint-aware). 2 exemples exécutésaussi nommée: last character final char trailing character ending charaussi écrite: RightChar
o1 = new stzString("ABC")
# first
? o1.FirstChar()
# last
? o1.LastChar()
#--> A
#--> C
test de la bibliothèqueQCSXTZZZIBWU
The chars of the string, as a list (codepoint-aware). 3 exemples exécutésaussi écrite: ToListOfChars
oAB  = new stzString("ab")
big  = new stzString( oAB.Repeated(1000000) )
oA = new stzString("a")
oBigA = new stzString( oA.Repeated(200000) )
# Chars() returns 200,000 single chars
? len(oBigA.Chars())
#--> 200000
test de la bibliothèqueQCSXTZZZIBWU
The 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
#--> CLOUD
test de la bibliothèqueaucune extension
The 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)
#--> 456
test de la bibliothèqueQCSXTZZZIBWU
FirstHalf
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()
#--> banana
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
SecondHalf
The second half of the string (the longer half when the length is odd).
exemple composé
o1 = new stzString("banana split")
? o1.SecondHalf()
#--> split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Halves
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
QCSXTZZZIBWU
IsCircledNumber
IsCircledNumber / IsCircledDigit -- Unicode-aware single-char predicates (Enclosed Alphanumerics block etc.).aussi écrite: IsCircledDigit
exemple composé
o1 = new stzString("banana split")
? o1.IsCircledNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Replace the chars at positions n1..n2 (inclusive) with pcNewSubStr. Ported from the legacy monolithic archive (~line 84916), kept minimal: pure numeric positions only. Symbolic forms (:First/:Last) are not yet supported. 5 exemples exécutés
o1 = new stzString("123--67--")
o1.ReplaceSection(1, 3, "~")
# collapsed
? o1.Content()
#--> ~--67--
test de la bibliothèqueQCSXTZZZIBWU
Sections
The substrings at the given [start, end] sections, as a list.QCSXTZZZIBWU
AntiSections
The substrings OUTSIDE the given sections, as a list.QCSXTZZZIBWU
FindAntiSections
The substrings between the occurrences of pcSubStr, as a list.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAntiSections("an") )
#--> [ "b", "a split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FindAsAntiSections
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 extension
AntiFindAsSections
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
QCSXTZZZIBWU
Range
The substring starting at nStart and spanning nRange chars (lenient).
exemple composé
o1 = new stzString("banana split")
? o1.Range(2, 5)
#--> anana
composé à partir de la signature, exécuté pour cette page
aucune extension
IsLeftToRight
TRUE if the string runs left-to-right (bidi direction).
exemple composé
o1 = new stzString("banana split")
? o1.IsLeftToRight()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
Whether 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 have
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]
test de la bibliothèqueQCSXTZZZIBWU
Same as ExistsInListCS: List membership predicates: does this string appear as an item in the given list of strings? Ported from the legacy monolithic archive (~line 98300). Backs the natural-language chain "Q(str).IsOneOfThese([...])" and its aliases. 1 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èqueQCSXTZZZIBWU
The first occurrence of the substring: the position(s). 9 exemples exécutésaussi écrite: FirstOccurrence · FindFirstSubString · FindFirstOccurrence
exemple composé
o1 = new stzString("banana split")
? o1.FindFirst("an")
#--> 2
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUSTD
Same as FindNextCS: FindNext: find the next occurrence of pcSubStr starting AFTER position nStart (so FindNext("x", 0) is equivalent to FindFirst). Ported from the legacy monolithic archive (~line 50328). Uses Haro's substr() with start-position support so it works for both case-sensitive and case-insensitive search without pulling in engine-level changes. 6 exemples exécutésaussi écrite: FindNextSubString
o1 = new stzString("123456789")
# nothing at or after 10
? o1.FindNext("1", :startingAt = 10)
#--> 0
test 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.FindNextNth(2, "an", 5)
#--> 0
composé à 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 extension
HtmlEscaped
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
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
ReplaceInSection: replace occurrences of pSubStr within the section [n1, n2] with pNew. Polymorphic on argument order: ReplaceInSection(n1, n2, pSubStr, pNew) -- bounds first ReplaceInSection(pSubStr, pNew, n1, n2) -- substrings first 1 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 Heart
test de la bibliothèqueQCSXTZZZIBWU
UppercaseSubString: uppercase a section or a named substring. Accepts: - UppercaseSubString(pcSub) : every occurrence - UppercaseSubString([n1, n2]) : 1-arg list form 1 exemples exécutés
o1 = new stzString("Thank you Irwin Rodriguez!")
o1.UppercaseSubString("Irwin")
o1.AddXT( 2Hearts(), :Around = "IRWIN" )
# Irwin is uppercased and hearted
? o1.Content()
#--> Thank you ♥♥IRWIN♥♥ Rodriguez!
test de la bibliothèqueQCSXTZZZIBWU
Shorten: truncate the content to the first N chars + "..." if it's longer than N. Defaults to N = 30. The "shorten the MIDDLE" family: keep N chars from each side and join them with an ellipsis. Shorten/ShortenN mutate; Shortened/ShortenedN return. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.Shorten()
? o1.Content()
#--> ban...lit
composé à 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 {...} 21
test 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 ... 321
test 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 {...} 54321
test de la bibliothèqueQCSXTZZZIBWU
Boxify
Boxify: surround the content with the Softanza box -- the SAME box-drawing glyphs as tables, grids, timelines and calendars (the VISUALITY design system; never plain +/- bars). Returns the boxed string; the content-mutating form is Box()/BoxXT().
exemple composé
o1 = new stzString("banana split")
? o1.Boxify()
#--> ┌──────────────┐
#--> │ banana split │
#--> └──────────────┘
composé à partir de la signature, exécuté pour cette page
aucune extension
Vowels
(sans commentaire dans la source : le nom se lit comme une phrase) vowelsdans la section essential find / contains / count
exemple 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és
exemple composé
o1 = new stzString("banana split")
o1.Extend("x")
? o1.Content()
#--> banana splitx
composé à 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 / count
o1 = new stzString("ABC")
o1.ExtendWith("DE")
# the content is now ABCDE
? o1.Content()
#--> ABCDE
test 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfVowels()
#--> 4
composé à 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.VowelNB()
#--> 0
composé à 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: Vowel
exemple composé
o1 = new stzString("banana split")
? o1.IsVowel()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasVowels
(sans commentaire dans la source : le nom se lit comme une phrase) has vowelsaussi écrite: ContainsVowelsdans la section essential find / contains / count
exemple composé
o1 = new stzString("banana split")
? o1.HasVowels()
#--> 1
composé à 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.VowelsB()
#--> 0
composé à 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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
CountNumbers
(sans commentaire dans la source : le nom se lit comme une phrase) count numbersdans la section essential find / contains / count
exemple composé
o1 = new stzString("banana split")
? o1.CountNumbers()
#--> 0
composé à 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.MinNumber()
#--> 0
composé à 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.MaxNumber()
#--> 0
composé à 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 / count
exemple composé
o1 = new stzString("banana split")
? o1.AverageOfNumbers()
#--> 0
composé à 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 / count
oS = 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 · FindSubString
oS = new stzString("tea rice tea fish")
? oS.Contains("tea")
? oS.NumberOfOccurrence("tea")
? @@( oS.FindAll("tea") )
#--> 1
#--> 2
#--> [ 1, 10 ]
test de la bibliothèqueQCSXTZZZIBWUSTDManyExcept
FindInSection
Same as FindInSectionCS: FindInSection: find occurrences of pcSubStr restricted to the character range [n1, n2]. Returns positions in the FULL string (not relative to the section). No match -> [].aussi écrite: FindAllInSection
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindInSection("an", 2, 5) )
#--> [ 2, 4 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
find all / find nth 9 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindNth(2, "an")
#--> 4
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUSTD
The last occurrence of the substring: the position(s). 9 exemples exécutés
o1 = new stzString("•♥••••♥••")
# FindLast('♥') is 7
? o1.FindLast("♥")
# FindLast('_') (absent) is 0
? o1.FindLast("_")
#--> 7
#--> 0
test de la bibliothèqueQCSXTZZZIBWUSTD
StartsWith
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 with
exemple composé
o1 = new stzString("banana split")
? o1.StartsWith("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Whether 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 with
exemple composé
o1 = new stzString("banana split")
? o1.EndsWith("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Predicates: does the string end with / start with a numeric character (0-9)? Ported from the legacy monolithic archive (line 100803) but kept self-contained -- no dependency on stzChar.IsANumber. Used by stzGlobal feature detection. 3 exemples exécutésaussi écrite: EndsWithNumber · ContainsAFinalNumber · EndsWithAFinalNumber · ContainsAnEndingNumber · ContainsATrailingNumber · EndsWithATrailingNumber
exemple composé
o1 = new stzString("banana split")
? o1.EndsWithANumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
starts with / ends with 1 exemples exécutésaussi écrite: StartsWithNumber · StartsWithALeadingNumber
exemple composé
o1 = new stzString("banana split")
? o1.StartsWithANumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Uppercase
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 SPLIT
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
An 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
#--> Tunis
test de la bibliothèqueaucune extension
Lowercase
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 extension
Capitalize
Capitalize the first letter in place (mutating). For a copy, use Capitalized.
exemple composé
o1 = new stzString("banana split")
o1.Capitalize()
? o1.Content()
#--> Banana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Capitalized
A copy with the first letter capitalized (title-style); original unchanged.aussi nommée: title case first letter capital sentence case proper case
exemple composé
o1 = new stzString("banana split")
? o1.Capitalized()
#--> Banana split
composé à partir de la signature, exécuté pour cette page
aucune extension
Reverse
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 ananab
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
A 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()
#--> 0123456789
test de la bibliothèqueaucune extension
Replace 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 instead
o1 = new stzString("R I N G")
o1.Replace(" ", "-")
# Replace() mutates the object
? o1.Content()
#--> R-I-N-G
test de la bibliothèqueQCSXTZZZIBWUMany
Same as Replace: replace every occurrence of pcSubStr (mutating). 7 exemples exécutés
o1 = new stzString("one two three four")
o1.ReplaceAll("two", "---")
# two became dashes
? o1.Content()
#--> one --- three four
test de la bibliothèqueQCSXTZZZIBWUExcept
Same 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, coffee
test de la bibliothèqueQCSXTZZZIBWU
Remove 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 drop
exemple composé
o1 = new stzString("banana split")
o1.Remove("an")
? o1.Content()
#--> ba split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUMany
RemoveAll
Same as Remove: remove every occurrence of pcSubStr (mutating).aussi nommée: delete strip erase get rid of take out drop
exemple composé
o1 = new stzString("banana split")
o1.RemoveAll("an")
? o1.Content()
#--> ba split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUExcept
ReplaceNth
(sans commentaire dans la source : le nom se lit comme une phrase) replace nthdans la section replace nth / first / last
exemple composé
o1 = new stzString("banana split")
o1.ReplaceNth(2, "an", "AN")
? o1.Content()
#--> banANa split
composé à 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 / last
exemple composé
o1 = new stzString("banana split")
o1.ReplaceFirst("an", "AN")
? o1.Content()
#--> bANana split
composé à 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 / last
exemple composé
o1 = new stzString("banana split")
o1.ReplaceLast("an", "AN")
? o1.Content()
#--> banANa split
composé à 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 / last
o1 = 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és
o1 = new stzString("bla bla <<word>> bla bla <<noword>> bla <<wording>>")
o1.ReplaceSubStringsBoundedBy([ "<<", ">>" ], "wrod")
# all three regions now hold wrod
? o1.Content()
#--> bla bla <<wrod>> bla bla <<wrod>> bla <<wrod>>
test de la bibliothèqueQCSXTZZZIBWU
ReplaceSubStringBoundedBy(pcWhat, pacBounds, pcNew): replace pcWhat with pcNew only when it sits inside a bounded section. pacBounds may be ["open","close"] OR a single string used both ways. ReplaceSubStringBoundedBy(pcWhat, bounds, :With = new): replace the occurrences of pcWhat that ARE a whole bounded region's content (the same equality contract as FindSubStringBoundedBy; same-string bounds pair with the overlap walk). 3 exemples exécutésQCSXTZZZIBWU
ReplaceSubStringAtPosition
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceAt
ReplaceAt(n, pcOld, pcNew) -- replace pcOld at position n with pcNew ReplaceAt(anPos, pcOld, :By = pcNew) -- list-of-positions form Haro's strict arity means the single-char form lives at ReplaceCharAt(n, pcNewChar) (positional or named-param). Three-arg signature -- callers using the 2-arg form should use ReplaceCharAt.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceAt(2, "an", "AN")
? o1.Content()
#--> bANana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceCharAt(:Position = n, :By = pcNew) -- named-param variant of ReplaceAt for char-at-position replacement. 2 exemples exécutés
o1 = new stzString("ABC*EF")
o1.ReplaceCharAt(:Position = 4, :By = "D")
# the star became D
? o1.Content()
#--> ABCDEF
test de la bibliothèqueQCSXTZZZIBWU
ReplaceCharAtSimple
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 split
composé à partir de la signature, exécuté pour cette page
aucune extension
ReplaceCharsAtPositions(anPos, :With/:By = pcNewChar) -- replace the char at each listed position with pcNewChar. 1 exemples exécutés
o1 = new stzString("AB3CD6EF9GH")
o1.ReplaceCharsAtPositions([ 3, 9, 6 ], Heart())
# all three replaced
? o1.Content()
#--> AB♥CD♥EF♥GH
test de la bibliothèqueQCSXTZZZIBWU
ReplaceCharsAtPositionsByMany(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és
o1 = new stzString("ab3de6gh9")
o1.ReplaceCharsAtPositionsByMany([3, 6, 9], [ "c", "f", "i" ])
# the alphabet restored
? o1.Content()
#--> abcdefghi
test de la bibliothèqueQCSXTZZZIBWU
Sit
Sit(:OnSection = [n1, n2], :AndHarvest = [:NCharsBefore=a, :NCharsAfter=b]) -- "sit on a section" and harvest a chars to the left + b chars to the right of it. Returns [cLeft, cRight]. Sit(:OnSection = [n1,n2] / :OnPosition = n, :AndHarvest = [...] / :AndHarvestSections = [...]): sit on a section (or single position) and harvest what's around it. Harvest specs: :NCharsBefore / :NCharsAfter (fixed counts) and :CharsBeforeW / :CharsAfterW (the run of chars satisfying a W predicate). The Sections variant returns the [start, end] spans instead of the substrings.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 / last
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfMarkers()
#--> 0
composé à 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
#--> 0
test 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
#--> 0
test 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 / last
o1 = new stzString("My name is #1, my age is #2, and my job is #3.")
# they are sorted
? o1.MarquersAreSorted()
# ... ascending
? o1.MarquersSortingOrder()
#--> 1
#--> ascending
test de la bibliothèqueaucune extension
MarkersAreUnsorted: TRUE when markers don't all monotone. 1 exemples exécutésaussi écrite: MarquersAreUnsorted
o1 = new stzString("My name is #1, my age is #3, and my job is #2.")
# they are unsorted
? o1.MarquersAreUnsorted()
# the order says so
? o1.MarquersSortingOrder()
#--> 1
#--> unsorted
test de la bibliothèqueaucune extension
MarkersSortingOrder: :Ascending, :Descending, :Unsorted, or :Undefined for fewer than 2 markers. 3 exemples exécutésaussi écrite: MarquersSortingOrder
o1 = new stzString("My name is #1, my age is #2, and my job is #3.")
# they are sorted
? o1.MarquersAreSorted()
# ... ascending
? o1.MarquersSortingOrder()
#--> 1
#--> ascending
test de la bibliothèqueaucune extension
SpacifyChars / SpacifyCharsUsing / SpacifyCharsXT -- char-wise Spacify variants: insert a separator between every pair of consecutive chars (with optional step + direction). 3 exemples exécutés
o1 = new stzString("99999999999")
o1.SpacifyChars()
# a space is inserted between every 9
? o1.Content()
#--> 9 9 9 9 9 9 9 9 9 9 9
test de la bibliothèqueQCSXTZZZIBWU
Spacify: 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èqueQCSXTZZZIBWU
SpacifyUsing
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 / last
o1 = new stzString("SOFTANZA")
o1.SpacifyCharsUsing("~")
# tilde-joined
? o1.Content()
#--> S~O~F~T~A~N~Z~A
test 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 / last
o1 = new stzString("**A1****A2***A3")
o1.RemoveFirst("A")
# the first A is gone
? o1.Content()
#--> **1****A2***A3
test 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 / last
o1 = new stzString("**A1****A2***A3")
o1.RemoveLast("A")
# the third A is gone
? o1.Content()
#--> **A1****A2***3
test 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 of
o1 = new stzString("123456789")
o1.InsertBefore([4, 7], "_")
# underscores land before positions 4 and 7
? o1.Content()
#--> 123_456_789
test de la bibliothèqueQCSXTZZZIBWU
InsertBeforePosition
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 split
composé à partir de la signature, exécuté pour cette page
aucune extension
ExtendToWith(n, pcChar): pad the string out to total length n by appending copies of pcChar at the end. 1 exemples exécutés
o1 = new stzString("ABC")
o1.ExtendToWith(5, "*")
# 'ABC' padded to width 5 with '*'
? o1.Content()
#--> ABC**
test de la bibliothèqueQCSXTZZZIBWU
Pad the string to total length n by cycling its own chars (mutating). 1 exemples exécutés
o1 = new stzString("123")
o1.ExtendToWithCharsRepeated(8)
# '123' repeated up to width 8
? o1.Content()
#--> 12312312
test de la bibliothèqueQCSXTZZZIBWU
Pad the string to total length n by cycling the given chars or range (mutating). 1 exemples exécutés
o1 = new stzString("123")
o1.ExtendToWithCharsIn( 8, "1":"3" )
# it grows to length 8 by cycling 1,2,3
? o1.Content()
#--> 12312312
test de la bibliothèqueQCSXTZZZIBWU
RemoveCharsWXT(pcCondition): remove every char where the predicate is TRUE. Predicate runs with @char bound. 6 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveCharsW("@char = 'a'")
? o1.Content()
#--> bnn split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveDuplicatedChars
RemoveDuplicatedChars: dedup chars in-place (keep first occurrence).
exemple composé
o1 = new stzString("banana split")
o1.RemoveDuplicatedChars()
? o1.Content()
#--> ban split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveDupChars
Same as RemoveDuplicatedChars: RemoveDuplicatedChars: dedup chars in-place (keep first occurrence).
exemple composé
o1 = new stzString("banana split")
o1.RemoveDupChars()
? o1.Content()
#--> ban split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertAt
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Insert pcSubStr AFTER position n -- or after the given anchor substring (mutating). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.InsertAfter(2, "an")
? o1.Content()
#--> baannana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertAfterPosition
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 split
composé à partir de la signature, exécuté pour cette page
aucune extension
InsertAfterPositions(anPos, pcStr): insert pcStr after each position in anPos. Walk descending so earlier positions stay valid as later inserts shift the string. 2 exemples exécutés
o1 = new stzString("SOFTANZA")
o1.InsertAfterPositions([ 2, 4, 6, 8 ], " ")
# pairs, no trailing space
? o1.Content()
#--> SO FT AN ZA
test de la bibliothèqueQCSXTZZZIBWU
InsertBeforePositions: mirror. Insert pcStr before EACH of the given positions (mutating). 1 exemples exécutés
o1 = new stzString("SOFTANZA")
o1.InsertBeforePositions([ 2, 4, 6, 8 ], " ")
# split look
? o1.Content()
#--> S OF TA NZ A
test de la bibliothèqueQCSXTZZZIBWU
InsertAfterEachNChars
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 sanplanit
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
The words of the string, as a list (whitespace-split by design). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? @@( o1.Words() )
#--> [ "banana", "split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUQQ
How many words the string holds. 1 exemples exécutésaussi nommée: word count how many words count the wordsaussi écrite: CountWords · HowManyWords
o1 = new stzString("the bread was cold and the tea was cold")
? o1.NumberOfWords()
#--> 9
test de la bibliothèqueaucune extension
StemmedInLanguage
(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")
#--> 0
composé à 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()
#--> 0
composé à 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()
#--> 0
composé à 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()
#--> neutral
composé à 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()
#--> 0
composé à 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()
#--> 0
composé à 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()
#--> 1
composé à 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()
#--> 0
composé à 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()
#--> 0
composé à 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: PartOfSpeechTags
exemple composé
o1 = new stzString("banana split")
? @@( o1.POSTags() )
#--> [ "NN", "NN" ]
composé à partir de la signature, exécuté pour cette page
aucune extension
TaggedWords
(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()
#--> 0
composé à 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.79
composé à 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: SearchTokens
exemple composé
o1 = new stzString("banana split")
? @@( o1.WordsForSearch() )
#--> [ "banana", "split" ]
composé à partir de la signature, exécuté pour cette page
aucune extension
WordsThatAre
Fluent text-meaning layer -- thin delegators to the text domain (base/natural/stzText). Canonical form is Q(str).Text().<op>(); these keep Q(str).<op>() working too.QCSXTZZZIBWU
(sans commentaire dans la source : le nom se lit comme une phrase) nouns 1 exemples exécutésdans la section linguistic query . explain . explore
exemple 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 . explore
exemple composé
o1 = new stzString("banana split")
? o1.Language()
#--> unknown
composé à 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 . explore
o1 = new stzString("The cat sat on the mat in the warm sun")
# lexical diversity is distinct/total words (8 distinct / 10)
? o1.LexicalDiversity()
ac = o1.ComparedTo("The dog sat on the mat in the cold rain")
# shared content vocabulary
? @@(ac[4][2])
#--> 0.80
#--> [ "sat", "mat" ]
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 . explore
exemple 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èqueQCSXTZZZIBWU
SplitToNParts
SplitToNParts: split the string into fixed-size character chunks of n characters each. The split is RIGHT-anchored (counting from the end of the string), which is the natural shape for digit grouping -- "1234567" with n=3 gives ["1", "234", "567"]. The Q form returns a stzList wrapper for fluent chaining.aussi écrite: SplitInNParts
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitToNParts(2) )
#--> [ "banana", " split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
A copy without leading and trailing whitespace; the original is unchanged. 2 exemples exécutésaussi nommée: without surrounding spaces whitespace stripped without padding cleaned
o1 = new stzString("  lots   of    whitespace  ")
# edges trimmed
? o1.Trimmed()
# then squeezed and shouted
? o1.SimplifyQ().Uppercased()
#--> lots   of    whitespace
#--> LOTS OF WHITESPACE
test de la bibliothèqueaucune extension
TrimmedLeft
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 line
exemple composé
o1 = new stzString("banana split")
? @@( o1.Lines() )
#--> [ "banana split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUQRT
How many lines the string holds. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLines()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE 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
#--> 1
test de la bibliothèqueaucune extension
TRUE if the string is a Unicode hex form like U+0041. 2 exemples exécutésaussi écrite: IsHexUnicode · IsAHexUnicode · IsHexUnicodeInString · RepresentsAHexUnicode · RepresentsAHexUnicodeInString
# HexPrefix() is '0x'
? HexPrefix()
# '0x066E' is a hex number
? Q( HexPrefix() + "066E").RepresentsNumberInHexForm()
# 'U+066E' is a unicode-hex number
? Q("U+066E").RepresentsNumberInUnicodeHexForm()
#--> 0x
#--> 1
#--> 1
test de la bibliothèqueaucune extension
Dotless / DotsRemoved: return the content with dots stripped from "i" and "j" (Unicode "Latin Letter Dotless I" / "Dotless J"). Lossy on purpose -- meant for the typographic effect, not for round-trippable encoding. Port from archive line 93405. DiacriticsRemoved: strip combining diacritic codepoints from the content. Uses NFD normalisation to decompose accented letters into base + combining marks, then drops any codepoint in the combining ranges: U+0300-U+036F Combining Diacritical Marks (Latin etc.) U+0610-U+061A Arabic U+064B-U+065F Arabic Tashkil (Fatha, Damma, ...) U+06D6-U+06ED Arabic supplementals U+0951-U+0954 Vedic / Devanagari 1 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 extension
RemoveDiacritics
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: HasDiacritics
exemple composé
o1 = new stzString("banana split")
? o1.ContainsDiacritics()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
DotsRemoved
The string in its dotless skeleton (rasm) -- the diacritic dots removed (Arabic-aware); the original is unchanged.aussi écrite: Dotless · WithoutDots · DotsOnLettersRemoved · WithoutDotsOnLetters
exemple composé
o1 = new stzString("banana split")
? o1.DotsRemoved()
#--> banana splıt
composé à partir de la signature, exécuté pour cette page
aucune extension
NLeftChars
The n leftmost chars, as a string (direction-aware).aussi écrite: NLeftCharsAsString
exemple composé
o1 = new stzString("banana split")
? o1.NLeftChars(2)
#--> ba
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
NRightChars
The n rightmost chars, as a string (direction-aware).aussi écrite: NRightCharsAsString
exemple composé
o1 = new stzString("banana split")
? o1.NRightChars(2)
#--> it
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
NFirstChars
The first n chars of the string.
exemple composé
o1 = new stzString("banana split")
? o1.NFirstChars(2)
#--> ba
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
The last n chars of the string. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.NLastChars(2)
#--> it
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Remove the chars at positions n1..n2 (mutating). 1 exemples exécutés
o1 = new stzString("ABC456DE")
o1.RemoveSection(4, 6)
# the digits vanish
? o1.Content()
#--> ABCDE
test de la bibliothèqueQCSXTZZZIBWU
Remove the chars of each given [start, end] section (mutating). 2 exemples exécutés
o1 = new stzString("1♥♥456♥♥901♥♥4")
o1.RemoveSections([ 2:3, 7:8, 12:13 ])
# the three heart pairs are gone
? o1.Content()
#--> 14569014
test de la bibliothèqueaucune extension
ReplaceSections
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és
o1 = new stzString("123---78--")
o1.ReplaceSectionsByMany([ [1, 3], [7, 8] ], [ "*", "~" ])
# shrunk
? o1.Content()
#--> *---~--
test de la bibliothèqueQCSXTZZZIBWU
Remove the leading spaces in place (mutating). For a copy, use TrimmedLeft. 2 exemples exécutésaussi nommée: strip leading spaces remove left whitespaceaucune extension
Remove the trailing spaces in place (mutating). For a copy, use TrimmedRight. 2 exemples exécutésaucune extension
TrimStart
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és
o1 = new stzString("12.58000")
o1.RemoveThisCharFromRightXT("0")
# the trailing zeros are gone
? o1.Content()
#--> 12.58
test de la bibliothèqueQCSXTZZZIBWU
ReplaceLeadingChars(:With = pcNew) -- collapse the leading run of a single repeated char into one instance of pcNew. Examples: "___VAR---" + :With="*" -> "*VAR---" "aaaaHELLO" + :With="A" -> "AHELLO" If there's no run (the first 2 chars differ), the string is returned unchanged. 3 exemples exécutésQCSXTZZZIBWU
Replace the run of identical chars at the end of the string with the given string (mutating). 3 exemples exécutésQCSXTZZZIBWU
Same as ReplaceLeadingChars: ReplaceLeadingChars(:With = pcNew) -- collapse the leading run of a single repeated char into one instance of pcNew. Examples: "___VAR---" + :With="*" -> "*VAR---" "aaaaHELLO" + :With="A" -> "AHELLO" If there's no run (the first 2 chars differ), the string is returned unchanged. 1 exemples exécutésQCSXTZZZIBWU
ReplaceLeadingChar(pcChar, :With = pcNew) -- replace the leading run only IF the leading char equals pcChar. Otherwise no-op. 3 exemples exécutésQCSXTZZZIBWU
Replace the trailing run of pcChar with the given string (mutating). 2 exemples exécutésaucune extension
Remove leading and trailing whitespace in place (mutating). For a copy, use Trimmed. 1 exemples exécutés
o1 = new stzString(" ♥♥♥123♥♥♥   ")
o1.Trim()
# only the spaces went
? o1.Content()
#--> ♥♥♥123♥♥♥
test de la bibliothèqueQCSXTZZZIBWU
ContainsDuplicates
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()
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsDuplicatedSubStrings
Same as ContainsDuplicatedSubStringsCS: TRUE if some substring occurs more than once in the string.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsDuplicatedSubStrings()
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
DuplicatedSubStrings
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
QCSXTZZZIBWU
NumberOfDuplicates
Same as NumberOfDuplicatesCS: How many duplicated occurrences the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfDuplicates()
#--> 4
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
HasDuplicatedChars
TRUE if some char occurs more than once.
exemple composé
o1 = new stzString("banana split")
? o1.HasDuplicatedChars()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
UpTo
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és
exemple composé
o1 = new stzString("banana split")
? o1.Boxed()
#--> ┌──────────────┐
#--> │ banana split │
#--> └──────────────┘
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
BoxedRound
A rounded-corner boxed copy of the string.aussi écrite: BoxedDashed · BoxedRounded
exemple composé
o1 = new stzString("banana split")
? o1.BoxedRound()
#--> ╭──────────────╮
#--> │ banana split │
#--> ╰──────────────╯
composé à partir de la signature, exécuté pour cette page
aucune extension
BoxedRoundedDashed
A rounded, dashed-line boxed copy of the string.aussi écrite: BoxedRoundDashed
exemple composé
o1 = new stzString("banana split")
? o1.BoxedRoundedDashed()
#--> ╭╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
#--> ┊ banana split ┊
#--> ╰╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
composé à partir de la signature, exécuté pour cette page
aucune extension
EachCharBoxed
Each char in its own box cell, as a string.aussi écrite: EachCharBoxed_alias
exemple 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
QCSXTZZZIBWU
BoxRoundEachChar
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 extension
TheseCharsZ
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 extension
AlignXT
Align the content in a field of nWidth chars, padded with cFillChar, to the given direction (mutating).QCSXTZZZIBWU
UniqueChars
Same as CharsU: The UNIQUE chars of the string, in first-seen order.
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 extension
The 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()
#--> 73
test de la bibliothèqueaucune extension
CharName / CharacterName / UnicodeName -- when the string IS a single character, return its Unicode name (CHECK MARK etc.). Convenient on Q("✓") narratives that avoid the StzCharQ() ramp. Haro chained-new+method parses oddly here, so split into two. 2 exemples exécutésaussi écrite: UnicodeName · CharacterNameaucune extension
Unicodes
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
QCSXTZZZIBWU
CharsAndUnicodes
Each char paired with its codepoint: [ [char, unicode], ... ].aussi écrite: UnicodePerChar
exemple 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
QCSXTZZZIBWU
UniqueCharsAndUnicodes
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 extension
The 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: RepeatedNTimes
exemple composé
o1 = new stzString("banana split")
? o1.Repeated(2)
#--> banana splitbanana split
composé à partir de la signature, exécuté pour cette page
aucune extension
Repeat
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Concatenate
Append the given string at the end (mutating). For a copy, use Concatenated.QCSXTZZZIBWU
Append
Same as Concatenate: Append the given string at the end (mutating). For a copy, use Concatenated.aussi nommée: add to the end concatenate tack on put after join to
exemple composé
o1 = new stzString("banana split")
o1.Append("an")
? o1.Content()
#--> banana splitan
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Concatenated
The string with pcStr appended, as data; the original is unchanged.
exemple composé
o1 = new stzString("banana split")
? o1.Concatenated("an")
#--> banana splitan
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the content equals the given string (case-sensitive). 6 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsEqualTo("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
IsStrictlyEqualTo
Strict equality: same content AND same Haro type (string). When the other side is a list/number, returns 0. Used by stzHashList.KeysForValue to compare values polymorphically.
exemple composé
o1 = new stzString("banana split")
? o1.IsStrictlyEqualTo(3)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveFirstCharCS(pCaseSensitive): "permissiveness" form -- accepts the case-sensitivity flag for narrative-symmetry, but ignores it (per stzStringTest block #37). (case-sensitive by default) 2 exemples exécutés
o1 = new stzString("1BATISTA")
o1.RemoveFirstChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("1BATISTA").FirstCharRemoved()
#--> BATISTA
#--> BATISTA
test de la bibliothèqueQCSXTZZZIBWU
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.RemoveLeadingChars()
? o1.Content()
#--> anana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
LeadingCharsAsString
LeadingChars() / TrailingChars() -- return the leading (or trailing) RUN of identical chars as a single string. e.g. "----Haro" -> "----". Used by narrative leading-char analysis. LeadingChars() returns the leading run as a LIST of chars (e.g. ["-","-","-"]); LeadingCharsAsString() returns the run "---".aussi écrite: LeadingSubString · LeadingCharsAsSubStringQCSXTZZZIBWU
The run of identical chars at the START of the string, as a list of chars. 1 exemples exécutésQCSXTZZZIBWU
The leading char (case-dial form). (case-sensitive by default) 1 exemples exécutés
o1 = new stzString("000122.12")
# the leading char
? o1.LeadingChar()
o1.RemoveThisLeadingChar("0")
# the run is gone
? o1.Content()
#--> 0
#--> 122.12
test de la bibliothèqueQCSXTZZZIBWU
NumberOfLeadingChars
Same as NumberOfLeadingItems: How long the leading char run is. (case-sensitive by default)
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLeadingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
TrailingCharsAsString
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ésQCSXTZZZIBWU
NumberOfTrailingChars
Same as NumberOfTrailingItems: How long the trailing char run is. (case-sensitive by default)
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfTrailingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveLeadingChar
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveAnyLeadingChar
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.
exemple composé
o1 = new stzString("banana split")
o1.RemoveAnyLeadingChar()
? o1.Content()
#--> anana split
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveTrailingChar
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 spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveTrailingChars
Drop the whole trailing run of the string's last char (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveTrailingChars()
? o1.Content()
#--> banana spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveBoundingChars
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.
exemple composé
o1 = new stzString("banana split")
o1.RemoveBoundingChars()
? o1.Content()
#--> anana spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Immutable / past-tense forms: return the modified content without mutating This. Used by stzNumber.Absolute() and similar fluent chains. 1 exemples exécutés
o1 = new stzString("1BATISTA")
o1.RemoveFirstChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("1BATISTA").FirstCharRemoved()
#--> BATISTA
#--> BATISTA
test de la bibliothèqueaucune extension
A copy with the last char removed; the original is unchanged. 1 exemples exécutés
o1 = new stzString("BATISTA1")
o1.RemoveLastChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA1").LastCharRemoved()
#--> BATISTA
#--> BATISTA
test de la bibliothèqueaucune extension
Remove the last char of the string (mutating). 1 exemples exécutés
o1 = new stzString("BATISTA1")
o1.RemoveLastChar()
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA1").LastCharRemoved()
#--> BATISTA
#--> BATISTA
test de la bibliothèqueQCSXTZZZIBWU
Same as RemoveFirstChar: RemoveFirstCharCS(pCaseSensitive): "permissiveness" form -- accepts the case-sensitivity flag for narrative-symmetry, but ignores it (per stzStringTest block #37). (case-sensitive by default) 1 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]}U
test de la bibliothèqueQCSXTZZZIBWU
Conditional first/last char removers: act only if the first (resp. last) char equals pcChar. Used by code-string fluent chains that may or may not see leading/trailing braces. 2 exemples exécutés
o1 = new stzString("{abc}")
o1.RemoveThisFirstChar("{")
o1.RemoveThisLastChar("}")
# both braces gone
? o1.Content()
#--> abc
test de la bibliothèqueQCSXTZZZIBWU
Remove the last char when it equals pcChar (mutating). 1 exemples exécutés
o1 = new stzString("{abc}")
o1.RemoveThisFirstChar("{")
o1.RemoveThisLastChar("}")
# both braces gone
? o1.Content()
#--> abc
test de la bibliothèqueQCSXTZZZIBWU
The raw bytes of the string, as a list. 1 exemples exécutés
o1 = 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 extension
BytesPerChar
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 extension
How many bytes each char occupies (UTF-8), as a list. 1 exemples exécutés
o1 = 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 extension
The size of the string in bytes (UTF-8). 1 exemples exécutés
o1 = 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 extension
Bytecodes
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 extension
BytecodesPerChar
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 extension
SizeInBytesPerChar
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 extension
The size of the string in bytes (UTF-8). 3 exemples exécutés
o1 = 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 extension
Same as ContainsOneOfTheseCS: TRUE if the string contains at least ONE of the given substrings. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOneOfThese([ "an", "a" ])
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsEither(arg1, arg2): two-arg form covers the narrative shapes. arg2 can be the :Or = "..." named-param, or any string (treated as the second alternative); if arg1 is itself a list of substrings and arg2 is "", we fall back to ContainsOneOfThese. 1 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
#--> 1
test de la bibliothèqueaucune extension
Same 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èqueQCSXTZZZIBWU
Remove the given opening and closing bounds when they enclose the string (mutating). 2 exemples exécutés
o1 = new stzString("<<word>>")
# it is angle-bounded
? o1.IsBoundedBy(["<<", ">>"])
o1.RemoveTheseBounds("<<",">>")
# stripped
? o1.Content()
#--> 1
#--> word
test de la bibliothèqueQCSXTZZZIBWU
Single-bound forms: same character on both sides. E.g. RemoveBounds('"') strips matching leading + trailing quotes. RemoveBounds(): no-arg, AUTO-detects the bounds and removes them in place (the mutating active form of BoundsRemoved). Matches the original. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveBounds()
? o1.Content()
#--> anana spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveThisBound
RemoveThisBound(c): remove a specific same-char bound from both ends.
exemple composé
o1 = new stzString("banana split")
o1.RemoveThisBound("an")
? o1.Content()
#--> ba split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as BetweenCS: Between() returns ALL substrings between bounds (Softanza Universal Naming Convention) FirstBetween/LastBetween/NthBetween for specific occurrences Between: the GREEDY single span between the FIRST open and the LAST close (matches the original Softanza Between -- returns a STRING, not a list). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.Between(TRUE, TRUE)
#--> ba
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as BoundedByCS: BoundedBy: same semantics as Between() (returns the list of substrings sitting between matched open/close delimiters) but takes the bounds packed as a 2-list [ open, close ]. Matches the archive API at line 34272 + 34290. Used by ccode tests that read like `o1.BoundedBy([ "[", "]" ])`. 3 exemples exécutésaussi écrite: SubStringsBoundedBy · AnySubStringsBoundedBy
o1 = new stzString("blabla bla <<word1>> bla bla <<word2>>")
? o1.SubstringsBoundedBy([ "<<", ">>" ])
#--> word1
#--> word2
test de la bibliothèqueQCSXTZZZIBWU
AnyBoundedBy
AnyBoundedBy: the bounded SUBSTRINGS, derived from FindAnyBoundedByZZ so a repeated single bound ("*") keeps every overlapping region (BoundedBy's non-overlapping pairing drops the middles). AnyBoundedByZZ pairs each substring with its [start, end] span.QCSXTZZZIBWU
ContainsSubStringsBoundedBy
TRUE if some substring is bounded by the given bounds. (case-sensitive by default)aussi écrite: ContainsBoundedBy · ContainsAnyBoundedBy
exemple composé
o1 = new stzString("banana split")
? o1.ContainsSubStringsBoundedBy([ "an", "a" ])
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FirstBetween
Same as FirstBetweenCS: first between (single result)QCSXTZZZIBWU
LastBetween
Same as LastBetweenCS: last between (single result)QCSXTZZZIBWU
NthBetween
Same as NthBetweenCS: nth between (single result)QCSXTZZZIBWU
ReplaceBetween
Engine replaces INCLUDING bounds. For default (bounds preserved), we wrap replacement with pcOpen + replacement + pcClose. IB variants pass replacement directly (engine includes bounds).
exemple composé
o1 = new stzString("banana split")
o1.ReplaceBetween("an", "an", "AN")
? o1.Content()
#--> banANana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceFirstBetween
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceLastBetween
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceNthBetween
Replace what lies between the NTH pcOpen...pcClose pair (the bounds stay) -- mutating.QCSXTZZZIBWU
Remove what lies between every pcOpen...pcClose pair (the bounds stay) -- mutating. 2 exemples exécutés
o1 = new stzString("__/♥\__")
o1.RemoveBetween("/", "\")
# the heart between / and \\ is gone, bounds kept
? o1.Content()
#--> __/\__
test de la bibliothèqueQCSXTZZZIBWU
RemoveFirstBetween
Remove what lies between the FIRST pair only (the bounds stay) -- mutating.QCSXTZZZIBWU
RemoveLastBetween
Remove what lies between the LAST pair only (the bounds stay) -- mutating.QCSXTZZZIBWU
RemoveNthBetween
Remove what lies between the NTH pair only (the bounds stay) -- mutating.QCSXTZZZIBWU
replace many by many 3 exemples exécutésQCSXTZZZIBWU
ContainsThese
contains theseaussi écrite: ContainsAllOfThese
exemple composé
o1 = new stzString("banana split")
? o1.ContainsThese([ "an", "a" ])
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as FindAsSectionsCS: The [start, end] section of every occurrence of pcSubStr. 2 exemples exécutésaussi écrite: FindAllAsSections
o1 = 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èqueQCSXTZZZIBWUD
FindAsSection
Same as FindAsSectionCS: Singular form: returns the first occurrence as a [start, end] section (rather than a list of sections). Useful when the narrative cares about "where IS that one substring".aussi écrite: FindFirstAsSection
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAsSection("an") )
#--> [ 2, 3 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUST
Same as FindManyAsSectionsCS: Plural with explicit "Many" prefix: same semantics as FindAsSections but accepts a list of substrings, with the results from all of them flattened into a single ordered list. 1 exemples exécutés
o1 = new stzString("...emm...eh..emm...eh")
? @@( o1.FindMany([ "emm", "eh" ]) )
? @@(o1.FindManyAsSections([ "emm", "eh" ]))
? @@( o1.Find([ "emm", "eh" ]) )
? @@(o1.FindAsSections([ "emm", "eh" ])) # Of FindZZ() for short
#--> [ 4, 10, 14, 20 ]
#--> [ [ 4, 6 ], [ 10, 11 ], [ 14, 16 ], [ 20, 21 ] ]
#--> [ 4, 10, 14, 20 ]
#--> [ [ 4, 6 ], [ 10, 11 ], [ 14, 16 ], [ 20, 21 ] ]
test de la bibliothèqueQCSXTZZZIBWU
MultiReplaced
Same as MultiReplacedCS: ONE-PASS dictionary replace: old[i] -> new[i], scanning the text ONCE. The FIRST matching pattern (in list order) wins at each position and the scan advances past it -- so a replacement's output is NEVER re-matched (no cascade). Contrast the classic ReplaceManyByMany which runs N sequential Replace passes (N full rebuilds + cascade). For templating, sanitization and dictionary substitution. Patterns must not contain NUL.QCSXTZZZIBWU
MultiReplace
Replace each substring of paOlds with its counterpart in paNews (pairwise, mutating).QCSXTZZZIBWU
ManyReplaced
Same as ManyReplacedCS: Immutable forms of ReplaceMany. Return the new string content without mutating This. Ported from archive line 41923.aussi écrite: TheseReplaced · SubStringsReplaced · ManySubstringsReplaced · TheseSubstringsReplaced
exemple composé
o1 = new stzString("banana split")
? o1.ManyReplaced([ "an", "a" ], "AN")
#--> bANANAN split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveNth
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Surround
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 splitan
composé à partir de la signature, exécuté pour cette page
aucune extension
Duplicates(): every duplicated SUBSTRING (not just chars), deduped, in (i,j) scan order -- matches the original DuplicatesCS. e.g. "RINGORIALAND" -> [ "R","I","A","N", ...multi-char dups... ]. (For a string with no repeated multi-char run, this coincides with the duplicated chars.) 3 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? @@( o1.Duplicates() )
#--> [ "a", "an", "n", "na" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
IsPalindrome
Same as IsPalindromeCS: TRUE if the string reads the same backward (a palindrome).
exemple composé
o1 = new stzString("banana split")
? o1.IsPalindrome()
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
IsPalindromeWords
TRUE if the WORD sequence reads the same backward.
exemple composé
o1 = new stzString("banana split")
? o1.IsPalindromeWords()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Same as IsAnagramOfCS: TRUE if the string is an anagram of the given one (same chars, reordered). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsAnagramOf("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
TRUE 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
#--> 1
test de la bibliothèqueaucune extension
TRUE 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()
#--> 1
test de la bibliothèqueaucune extension
IsCapitalcase
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsHybridcase
TRUE if the string mixes upper and lower case.
exemple composé
o1 = new stzString("banana split")
? o1.IsHybridcase()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsTitlecase
TRUE if the string is written in Title Case.
exemple composé
o1 = new stzString("banana split")
? o1.IsTitlecase()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCamelCase
TRUE if the string is written in camelCase.
exemple composé
o1 = new stzString("banana split")
? o1.IsCamelCase()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsSnakeCase
TRUE if the string is written in snake_case.
exemple composé
o1 = new stzString("banana split")
? o1.IsSnakeCase()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsKebabCase
TRUE if the string is written in kebab-case.
exemple composé
o1 = new stzString("banana split")
? o1.IsKebabCase()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOnlySpaces
TRUE if the string is made of spaces only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlySpaces()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOnlyLetters
TRUE if the string is made of letters only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyLetters()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOnlyNumbers
TRUE if the string is made of number chars only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyNumbers()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOnlyDigits
TRUE if the string is made of digits only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyDigits()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOnlyLettersAndNumbers
TRUE if the string is made of letters and numbers only.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyLettersAndNumbers()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Same 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" ])
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
IsMadeOfChar
Same as IsMadeOfCharCS: TRUE if the string is made of the given char only.
exemple composé
o1 = new stzString("banana split")
? o1.IsMadeOfChar("a")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same 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() )
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
IsCountryName
TRUE if the string names a country (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryName()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCountryAbbreviation
TRUE if the string is a country abbreviation (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryAbbreviation()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCountryNumber
TRUE if the string is a numeric country code (per the locale data).aussi écrite: IsCountryCode
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCountryPhoneCode
TRUE if the string is a country phone code.
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryPhoneCode()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsLanguageName
TRUE if the string names a language (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsLanguageName()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsLanguageNumber
TRUE if the string is a numeric language code.aussi écrite: IsLanguageCode
exemple composé
o1 = new stzString("banana split")
? o1.IsLanguageNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string is a language abbreviation. 2 exemples exécutés
? StzStringQ("ar").IsLanguageAbbreviation()
? IsLanguageAbbreviation("ar")
#--> 1
#--> 1
test de la bibliothèqueaucune extension
TRUE if the string has an ISO locale shape (like en-US). 2 exemples exécutés
o1 = new stzString("ar_Arab_TN")
# well formed
? o1.IsLocaleAbbreviation()
#--> 1
test de la bibliothèqueaucune extension
IsCurrencyName
TRUE if the string names a currency (per the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCurrencyName()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCurrencySymbol
Currency-symbol check (stub: the monolith left it TODO; completes with the locale data).
exemple composé
o1 = new stzString("banana split")
? o1.IsCurrencySymbol()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string names a script (per the locale data). 2 exemples exécutésaussi écrite: IsScript
# yes
? StzStringQ("latin").IsScriptName()
#--> 1
test de la bibliothèqueaucune extension
TRUE if the string is a script code. 1 exemples exécutésaussi écrite: IsScriptNumber
exemple composé
o1 = new stzString("banana split")
? o1.IsScriptCode()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string is a script abbreviation. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsScriptAbbreviation()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOneOccurrence
Same as ContainsOneOccurrenceCS: TRUE if the substring occurs EXACTLY once.aussi écrite: ContainsOne · ContainsOnlyOne
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOneOccurrence("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as ContainsNTimesCS: TRUE if the substring occurs exactly n times. 2 exemples exécutés
? Q("ar_arab_tn").ContainsNTimes(2,"_")
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
RepresentsInteger
TRUE if the string is an integer literal.aussi écrite: RepresentsCalculableInteger
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsInteger()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RepresentsSignedInteger
TRUE if the string is a SIGNED integer literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsSignedInteger()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RepresentsUnsignedInteger
TRUE if the string is an UNSIGNED integer literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsUnsignedInteger()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE 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()
#--> 1
test de la bibliothèqueaucune extension
RepresentsSignedNumber
TRUE if the string is a SIGNED number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsSignedNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RepresentsUnsignedNumber
TRUE if the string is an UNSIGNED number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsUnsignedNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string holds a numeric literal. 3 exemples exécutés
# IsNumberInString on a space
? Q(" ").IsNumberInString()
#--> 0
test de la bibliothèqueaucune extension
TRUE 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
#--> 1
test de la bibliothèqueaucune extension
FilledWith
FilledWith(pItem): for an empty (or any) wrapped string, set the content to the string form of pItem and return it. Used for the 'start from an empty stzString and fill it with this value' fluent shape.
exemple composé
o1 = new stzString("banana split")
? o1.FilledWith("a")
#--> a
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ToList
ToList: if the string represents a Haro list literal ("[1,2,3]"), eval it into the actual list. Otherwise returns the chars. Used by stzSmallFuncs.StzN to count list-in-string elements.
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
QCSXTZZZIBWU
TRUE if the string is a valid number literal (any base form). 2 exemples exécutésaussi écrite: RepresentsCalculableNumber
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string is a decimal number literal. 1 exemples exécutésaussi écrite: RepresentsNumberInDecimalForm
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsDecimalNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE 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
#--> 0
test de la bibliothèqueaucune extension
TRUE if the string is a hexadecimal number literal. 2 exemples exécutésaussi écrite: RepresentsNumberInHexForm
# hex form
? Q("x4E992").RepresentsNumberInHexForm()
#--> 1
test de la bibliothèqueaucune extension
TRUE if the string is an octal number literal. 2 exemples exécutésaussi écrite: RepresentsNumberInOctalForm
# octal form
? Q("o01234567").RepresentsNumberInOctalForm()
#--> 1
test de la bibliothèqueaucune extension
IsBlank
TRUE if the string is empty or whitespace only.
exemple composé
o1 = new stzString("banana split")
? o1.IsBlank()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsIdentifier
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsBalanced
TRUE if the brackets and parentheses in the string are balanced.
exemple composé
o1 = new stzString("banana split")
? o1.IsBalanced()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
IsNestedUsing
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")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
IsNested
TRUE if the string's bounds nest (bounded regions inside bounded regions).
exemple composé
o1 = new stzString("banana split")
? o1.IsNested()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsEmailLike
TRUE if the string looks like an email address.
exemple composé
o1 = new stzString("banana split")
? o1.IsEmailLike()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsUrlLike
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsIsogram
TRUE if no char repeats in the string (an isogram).
exemple composé
o1 = new stzString("banana split")
? o1.IsIsogram()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsWord
TRUE if the string is a single word.
exemple composé
o1 = new stzString("banana split")
? o1.IsWord()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE 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
#--> 1
test de la bibliothèqueaucune extension
IsADigit
TRUE if the string is a single digit.
exemple composé
o1 = new stzString("banana split")
? o1.IsDigit()
#--> 0
composé à 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 extension
IsCharsSortedAscending
TRUE if the chars are in ascending order.aussi écrite: IsCharsSortedAsc
exemple composé
o1 = new stzString("banana split")
? o1.IsCharsSortedAscending()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCharsSortedDescending
TRUE if the chars are in descending order.aussi écrite: IsCharsSortedDesc
exemple composé
o1 = new stzString("banana split")
? o1.IsCharsSortedDescending()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string starts with a repeated char run. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HasLeadingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
TRUE if the string ends with a repeated char run. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HasTrailingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
HasLeadingAndTrailingChars
TRUE if the string both starts AND ends with repeated char runs.
exemple composé
o1 = new stzString("banana split")
? o1.HasLeadingAndTrailingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsReversedCopyOf
Same as IsReversedCopyOfCS: TRUE if the string is the reverse of the given one.
exemple composé
o1 = new stzString("banana split")
? o1.IsReversedCopyOf("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsLatin
TRUE if the string contains Latin chars.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsLatin()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsArabic
TRUE if the string contains Arabic chars.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsArabic()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsChar
Same as ContainsCharCS: TRUE if the string contains the given char.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsChar("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsAnyOfChars
Same as ContainsAnyOfCharsCS: contains char / any / all
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAnyOfChars("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsAllOfChars
Same as ContainsAllOfCharsCS: contains char / any / all
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAllOfChars("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsOnlyChars
Same as ContainsOnlyCharsCS: contains char / any / all
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyChars("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FindInvisibleChars
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()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
IsControl
TRUE if the string is made of control chars.
exemple composé
o1 = new stzString("banana split")
? o1.IsControl()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasMark
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.HasMark()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
CharIsControlAt
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.CharIsControlAt(2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
CharIsMarkAt
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.CharIsMarkAt(2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
CharIsSpaceAt
control / mark checks
exemple composé
o1 = new stzString("banana split")
? o1.CharIsSpaceAt(2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
OnlyMarks
only marks / controlsaucune extension
OnlyControls
only marks / controlsaucune extension
OnlyLatinLetters
only marks / controls
exemple composé
o1 = new stzString("banana split")
? o1.OnlyLatinLetters()
#--> bananasplit
composé à partir de la signature, exécuté pour cette page
aucune extension
IsNumericString
TRUE if the string is numeric.aussi écrite: IsANumber
exemple composé
o1 = new stzString("banana split")
? o1.IsNumericString()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsAlphaString
numeric / alpha checksaussi écrite: IsAllLetters
exemple composé
o1 = new stzString("banana split")
? o1.IsAlphaString()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
MatchesRegex
TRUE if the string matches the given regex pattern.aussi écrite: IsMatchedByRegex
exemple composé
o1 = new stzString("banana split")
? o1.MatchesRegex("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ENGINE-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 · Substrongs
o1 = new stzString("RINGORIALAND")
# there are 12*13/2 = 78 substrings
? o1.NumberOfSubStrings()
# SubStrings() returns that many
? len( o1.SubStrings() )
#--> 78
#--> 78
test de la bibliothèqueQCSXTZZZIBWUWF
How many substrings the string yields. 4 exemples exécutésaussi écrite: HowManySubStrings
o1 = new stzString("..ONE..TWO..ONE..")
# all substrings
? o1.NumberOfSubStrings()
# unique substrings
? o1.NumberOfUniqueSubStrings()
#--> 153
#--> 120
test de la bibliothèqueQCSXTZZZIBWU
UniqueSubStrings
Same as SubStringsU: Same as SubStringsCS: ENGINE-BACKED (StzEngineStringSubStringsUniqueCS): dedup, first-seen order. cs=1 exact, cs=0 case-insensitive. Retires the O(n^3) loop.aucune extension
How many DISTINCT substrings the string yields. 1 exemples exécutés
o1 = new stzString("..ONE..TWO..ONE..")
# all substrings
? o1.NumberOfSubStrings()
# unique substrings
? o1.NumberOfUniqueSubStrings()
#--> 153
#--> 120
test de la bibliothèqueaucune extension
IndexOf
(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")
#--> 2
composé à 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")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
EndsWithAny
(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")
#--> 0
composé à 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
QCSXTZZZIBWU
FindAnyBoundedByAsSections
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
QCSXTZZZIBWU
FindAnyBoundedBy
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
QCSXTZZZIBWU
FindAnyBoundedByIBAsSections
Same as FindSubStringsBoundedByIBZZ: FindSubStringsBoundedByIBZZ: for every substring bounded by pacBounds[1]..pacBounds[2] return the [startPos, endPos] pairs INCLUDING the bounds (IB = inclusive bounds). Ported from archive line 34794; self-contained scan rather than the SectionsBetween-based archive version.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnyBoundedByIBAsSections([ "an", "a" ]) )
#--> [ [ 2, 4 ] ]
composé à partir de la signature, exécuté pour cette page
aucune extension
DeepFindBoundedByZZ
The [start, end] sections of the bounded substrings at EVERY nesting depth.aussi écrite: DeepFindSubStringsZZ · DeepFindSubStringsBoundedByZZ
exemple composé
o1 = new stzString("banana split")
? @@( o1.DeepFindBoundedByZZ([ "an", "a" ]) )
#--> [ [ 6, 5 ] ]
composé à partir de la signature, exécuté pour cette page
aucune extension
DeepBoundedBy
The bounded substrings at every nesting depth.QCSXTZZZIBWU
DeepSubStringsZZ
The nested bounded substrings with their [start, end] sections.aussi écrite: DeepSubStringsBoundedByZZ
exemple composé
o1 = new stzString("banana split")
? @@( o1.DeepSubStringsZZ([ "an", "a" ]) )
#--> [ [ "", [ 6, 5 ] ] ]
composé à partir de la signature, exécuté pour cette page
aucune extension
DeepFindBoundedByIBZZ
The nested bounded sections, bounds INCLUDED (IB).aussi écrite: DeepFindSubStringsBoundedByIBZZ
exemple composé
o1 = new stzString("banana split")
? @@( o1.DeepFindBoundedByIBZZ([ "an", "a" ]) )
#--> [ [ 4, 6 ] ]
composé à partir de la signature, exécuté pour cette page
aucune extension
DeepSubStringsBoundedByIBZZ
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 extension
NestedSubStrings
The bounded substrings including the NESTED ones.QCSXTZZZIBWU
RemoveSubStringsBoundedByIB
RemoveSubStringsBoundedByIB([o,c]): drop every bounded region together with -- its bounds (e.g. removing the "]---[" runs from "Hello ]---[Haro!]---[" -> -- "Hello Haro!"). MUTATING; returns This.QCSXTZZZIBWU
FindSubStringsAsSectionsW(pcCondition): enumerate every substring [start, end] and return the sections where the @SubString predicate is TRUE. Engine-backed (stzList.FindW over the candidates), no eval(). FindSubStringsAsSectionsW(pcCondition): the [start,end] sections of every substring matching the predicate. Engine-backed -- enumerates the candidate substrings and evaluates the @SubString predicate via the list W-DSL (stzList.FindW, predicate normalized: { } stripped, @SubString -> @item, Q().Method() lowered), with NO eval(). For engine-expressible predicates (=, or, and, comparisons); for richer ones use the WF form below. Replaces the retired raw-eval FindSubStringsAsSectionsWXT. 1 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èqueQCSXTZZZIBWUF
The 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èqueQCSXTZZZIBWUF
FindSubStringsMadeOf
FindSubStringsMadeOf(pcChar): return the start positions of each MAXIMAL run of pcChar in the content. e.g. "..._...__" with pcChar="_" -> [4, 8]. "Made of" runs: the arg is a POOL of chars ("12" = chars 1 and 2), and a run is a maximal stretch whose every char belongs to the pool.aussi écrite: FindMadeOf
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringsMadeOf("an") )
#--> [ 2 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FindNthOccurrenceCS / FindNthOccurrence: n-th match of pcSub inside the content. Engine-backed. (case-sensitive by default) 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindNthOccurrence(2, "an")
#--> 4
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
AllPositionsOf
All positions of pcSub (collect-them-all helper).aussi écrite: FindMarker · FindMarquer · OccurrencesOfMarquer
exemple composé
o1 = new stzString("banana split")
? @@( o1.AllPositionsOf("an") )
#--> [ 2, 4 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
FindFirstNOccurrences
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 extension
FindLastNOccurrences
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 extension
HowMany family: count occurrences of pcSub in the content. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HowMany("an")
#--> 2
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUST
How long the trailing char run is. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HowManyTrailingChar()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HowManyLeadingChar
How long the leading char run is.
exemple composé
o1 = new stzString("banana split")
? o1.HowManyLeadingChar()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HowManyOccurrenceOfCharRightSide
HowManyOccurrenceOfCharRightSide(pcChar) / EndSide: count the trailing run of pcChar.aussi écrite: HowManyOccurrenceOfCharEndSide · NumberOfOccurrenceOfCharEndSide · NumberOfOccurrenceOfCharRightSide · NumberOfOccurrenceOfCharEndingSide
exemple composé
o1 = new stzString("banana split")
? o1.HowManyOccurrenceOfCharRightSide("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HowManyOccurrenceOfCharLeftSide
How many times the char repeats at the START of the string.aussi écrite: HowManyOccurrenceOfCharStartSide · NumberOfOccurrenceOfCharLeftSide · NumberOfOccurrenceOfCharStartSide · NumberOfOccurrenceOfCharStartingSide
exemple composé
o1 = new stzString("banana split")
? o1.HowManyOccurrenceOfCharLeftSide("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
SubStringsMadeOf
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
QCSXTZZZIBWU
FindSubStringBoundsUpToNCharsAsSections
FindSubStringBoundsUpToNCharsAsSections(pcSub, n) -- for each occurrence of pcSub, return the [startBefore, endBefore] section of up to n chars to its LEFT and the [startAfter, endAfter] section of up to n chars to its RIGHT. Returns a flat list of all such sections.aussi écrite: FindSubStringBoundsUpToNChars
exemple 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 extension
FindSubStringsBoundedBy(pacBounds): return the starting positions of each substring that sits between the open / close bounds. The bounds list may use the [open, :And = close] DSL shape or a plain [open, close] / single string for both ends. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindSubStringsBoundedBy([ "an", "a" ]) )
#--> [ 4 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FindSubStringsBetween
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
QCSXTZZZIBWU
FindSubStringBoundedBy
FindSubStringBoundedBy(pcWhat, pacBounds): return positions (only inside bounded sections) where pcWhat appears.QCSXTZZZIBWU
FindSubStringBoundedByAsSections
Same as FindSubStringBoundedByZZ: FindSubStringBoundedBy(pcWhat, pacBounds): return positions (only inside bounded sections) where pcWhat appears. (answers [start, end] sections)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
QCSXTZZZIBWU
FindBoundedSubStrings
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
QCSXTZZZIBWU
FindSubStringBounds
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
QCSXTZZZIBWU
RemoveTrailingSubString
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 spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Find the position of the next n-th marker after nFrom. 1 exemples exécutésaussi écrite: FindNextNthMarker
exemple composé
o1 = new stzString("banana split")
? o1.FindNextNthMarquer(2, 5)
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUST
ContainsSubStringBoundedBy(pcSub, pacBounds): TRUE if pcSub appears inside any bounded section. 1 exemples exécutés
# '♥♥♥' is enclosed by '^^' .. '^^'
? Q("^^♥♥♥^^").ContainsSubStringBoundedBy("♥♥♥", [ "^^", "^^" ])
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
FindAsSectionsStD
(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 extension
HexUnicodes
HexUnicodes(): hex codepoints for every char, returned as a list.aussi écrite: HexUnicodes_alias
exemple 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 extension
First2CharsAsString
First2CharsAsString / Last2CharsAsString: aliases.
exemple composé
o1 = new stzString("banana split")
? o1.First2CharsAsString()
#--> ba
composé à partir de la signature, exécuté pour cette page
aucune extension
Last2CharsAsString
The last two chars, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.Last2CharsAsString()
#--> it
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveSpacesQ_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és
o1 = new stzString("Ringprogramminglanguageispowerful!")
o1.SpacifySections([ [ 5, 15 ], [ 24, 25 ] ])
# each section's chars are spaced out
? o1.Content()
#--> Ringp r o g r a m m i n glanguagei spowerful!
test de la bibliothèqueQCSXTZZZIBWU
Shrink(): trim leading + trailing whitespace. Shrink([p1]): Shrink() : Trim Shrink(:ToPosition = N) : keep first N chars Shrink(N) : keep first N chars Implemented as 1-arg with optional sentinel NULL/empty for trim. 1 exemples exécutés
o1 = new stzString("ABCDE")
o1.Shrink( :ToPosition = 3 )
# 'ABCDE' shrunk to position 3
? o1.Content()
#--> ABC
test de la bibliothèqueQCSXTZZZIBWU
ShortenN(n): same as ShortenedN but mutates in place. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.ShortenN(2)
? o1.Content()
#--> ba...it
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsInSections(pcSub, aSections): TRUE if pcSub appears inside ANY of the listed sections. 1 exemples exécutés
o1 = new stzString("123♥♥678♥♥1234♥♥789")
# '♥' is inside section 3..10
? o1.ContainsInSection("♥", 3, 10)
# '♥' is inside all three sections
? o1.ContainsInSections("♥", [ [3,10], [8,12], [14,19] ])
#--> 1
#--> 1
test de la bibliothèqueaucune extension
ContainsBefore(pcSub, pcAnchor | :Position = n | :SubString = s): TRUE iff pcSub appears in the content BEFORE the anchor. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsBefore("an", "an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if pcSub occurs AFTER the anchor substring. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAfter("an", "an")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsOnlyOneOfThese(paSubStr): TRUE iff EXACTLY ONE of the listed substrings appears in the content (counting at least one occurrence as 1). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsOnlyOneOfThese([ "an", "a" ])
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsReverseOf
IsReverseOf(pcOther): TRUE iff This.Content() is the reverse of pcOther (codepoint-by-codepoint).
exemple composé
o1 = new stzString("banana split")
? o1.IsReverseOf("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HexUnicode
HexUnicode(): hex form of the codepoint (e.g. "A" -> "0041"). When the content is a single char, returns its codepoint hex; otherwise the codepoint of the first char.
exemple composé
o1 = new stzString("banana split")
? o1.HexUnicode()
#--> U+0062
composé à partir de la signature, exécuté pour cette page
aucune extension
First2Chars
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 extension
Last2Chars
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 extension
Last3Chars
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 extension
First3Chars
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 extension
The first n chars, as a string. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FirstNChars(2)
#--> ba
composé à partir de la signature, exécuté pour cette page
aucune extension
The last n chars, as a string. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.LastNChars(2)
#--> it
composé à partir de la signature, exécuté pour cette page
aucune extension
ExtendToNChars(n): pad content with spaces up to length n. 1 exemples exécutés
o1 = new stzString("ABC")
o1.ExtendToNChars(5)
# 'ABC' padded to width 5
? o1.Content()
#--> ABC
test de la bibliothèqueQCSXTZZZIBWU
Spacified / 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 A
test de la bibliothèqueQCSXTZZZIBWU
A copy with the chars separated by the given separator. 1 exemples exécutés
o1 = new stzString("99999999999")
# Spacified() spaces the chars
? o1.Spacified()
# SpacifiedUsing('_') uses underscores
? o1.SpacifiedUsing("_")
#--> 9 9 9 9 9 9 9 9 9 9 9
#--> 9_9_9_9_9_9_9_9_9_9_9
test de la bibliothèqueaucune extension
SpacifyTheseSubStrings(paSubStr [, pcSep]): wrap each occurrence of every substring in paSubStr with pcSep on each side. pcSep defaults to " " when the second arg is omitted. 1 exemples exécutés
o1 = new stzString("MahmoudBertAhmedMansourIlirGalMajdi")
o1.SpacifyTheseSubStrings([
		"Mahmoud", "Bert", "Ahmed", "Mansour", "Ilir", "Gal", "Majdi" ])
# the names separate with single spaces, no edge spaces
? o1.Content()
#--> Mahmoud Bert Ahmed Mansour Ilir Gal Majdi
test de la bibliothèqueQCSXTZZZIBWU
SplitAtSections
SplitAtSections(aSections): the pieces of content sliced by the listed [n1, n2] sections. Each section becomes one piece. SplitAtSections(aSections): split AT the sections -- return the COMPLEMENT parts between them (the original monolith routes the complement computation through stzSplitter).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 extension
CommonSubStrings
CommonSubStrings(:With = pcOther): substrings appearing in both This and pcOther (set-style intersection at the char-substring level, capped at the smaller string's substring count).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: EndsWithThisNumber
exemple composé
o1 = new stzString("banana split")
? o1.EndsWithNumberN("an")
#--> 0
composé à 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és
o1 = new stzString("<<Go!>>")
# the bounds fall away
? o1.TheseBoundsRemoved("<<", ">>")
#--> Go!
test de la bibliothèqueQCSXTZZZIBWU
RemoveEmptyLines
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
#--> 1
test de la bibliothèqueaucune extension
RemoveAt
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
IsQuietEqualTo(pcOther): "quiet" equality -- accept up to ~30% char-level mismatches. Useful for fuzzy comparisons. Uses Levenshtein-style distance with simple thresholding. 3 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsQuietEqualTo("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
NextOccurrence(pcSub, nFrom): position of the next occurrence of pcSub strictly after nFrom. 2 exemples exécutés
o1 = new stzString("12500;NAME;10;0")
# the next one from 1
? o1.NextOccurrence( :Of = ";", :StartingAt = 1 )
# the 2nd from 5
? o1.NextNthOccurrence( 2, :Of = ";", :StartingAt = 5)
#--> 6
#--> 11
test de la bibliothèqueaucune extension
PreviousOccurrence
PreviousOccurrence(sub, nFrom): the last occurrence lying ENTIRELY before nFrom (the original searches Section(1, nFrom-1), so an occurrence overlapping nFrom does not count).
exemple composé
o1 = new stzString("banana split")
? o1.PreviousOccurrence("an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RepeatedLeadingChar(): the single char that begins a leading run of repeated chars (or "" if no run). 2 exemples exécutés
o1 = new stzString("exeeeeeTUNIS")
# no repeated leading char
? o1.RepeatedLeadingChar()
# empty list
? len( o1.RepeatedLeadingChars() )
#--> 0
test de la bibliothèqueaucune extension
RepeatedTrailingChar
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfRepeatedTrailingChars
How long the repeated run at the end is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfRepeatedTrailingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
SectionsOfSameItems
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
QCSXTZZZIBWU
ReplaceAnyBoundedBy(pacBounds, pcNew): wrapper over the substrings-bounded-by-replace family. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.ReplaceAnyBoundedBy([ "an", "a" ], "AN")
? o1.Content()
#--> banANana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceManyPairs
(ReplaceMany 2-list form: per-index pcOld[i] -> pcNew[i] via the existing ReplaceMany above.)QCSXTZZZIBWU
AntiFindAsSection
AntiFindAsSection: alias for the singular form (just first section from AntiFindAsSections, or [] if none). AntiFindAsSection: the FIRST complement span (the first gap not covered by an occurrence of pcSub).
exemple composé
o1 = new stzString("banana split")
? @@( o1.AntiFindAsSection("an") )
#--> [ 1, 1 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
Trailing/leading number helpers. TrailingNumber / LeadingNumber: decimal- and SIGN-aware, so "Amount: -132.45" trails "-132.45" and "-23.67 pounds" leads with "-23.67". 3 exemples exécutésaussi écrite: EndingNumberaucune extension
The number the string STARTS with, as a string (empty if none). 1 exemples exécutésaussi écrite: StartingNumberaucune extension
NumberOfTrailingNumberDigits
How many digits the trailing number has.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfTrailingNumberDigits()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfLeadingNumberDigits
How many digits the leading number has.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLeadingNumberDigits()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Bounds
Bounds(pcOpen, pcClose): the [open, close] positions of the first bounded match. Two-arg form. Bounds(): auto-detect leading and trailing non-letter runs - e.g. "<<Haro>>" -> [ "<<", ">>" ], "---Ring___" -> [ "---", "___" ]. Falls back to [ firstchar, lastchar ] for fully alphanumeric input. Bounds(): auto-detect the leading/trailing bound. Each side is the maximal run of the SAME edge char (when it is a bound char), so "<<Go!>>" -> [ "<<", ">>" ] -- the "!" is content, NOT swallowed into the trailing bound (the old "any non-alpha" walk greedily took "!>>").
exemple composé
o1 = new stzString("banana split")
? @@( o1.Bounds() )
#--> [ "b", "t" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
BoundsBetween
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 extension
HasRepeatedLeadingChars(): TRUE if the content begins with a run of identical chars (length >= 2). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HasRepeatedLeadingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasRepeatedTrailingChars
TRUE if the string ends with a repeated char run.
exemple composé
o1 = new stzString("banana split")
? o1.HasRepeatedTrailingChars()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Except
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 extension
Nth(n[, pcSub]): Nth(n) : the n-th char (1-based, codepoint-aware) Nth(n, pcSub) : position of the n-th occurrence of pcSub Negative n counts from the end (-1 = last). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.Nth(2, "an")
#--> 4
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUSTD
NthChar1
The char at position n (lenient 1-based form).
exemple composé
o1 = new stzString("banana split")
? o1.NthChar1(2)
#--> a
composé à partir de la signature, exécuté pour cette page
aucune extension
LastNItemsQRT
(NthChar already exists earlier; just expose Nth alias above.) LastNItemsQRT(n, pcType): the last n items wrapped in pcType. stzString surface: forward to LastNChars + appropriate wrapper.
exemple composé
o1 = new stzString("banana split")
? o1.LastNItemsQRT(2, "an")
#--> it
composé à partir de la signature, exécuté pour cette page
aucune extension
FirstNItemsQRT
The first n chars, in the requested return type (QRT).
exemple composé
o1 = new stzString("banana split")
? o1.FirstNItemsQRT(2, "an")
#--> ba
composé à partir de la signature, exécuté pour cette page
aucune extension
FindLastAsSection
FindLastAsSection: [start, end] of the last occurrence of pcSub.aussi écrite: FindLasteAsSection
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindLastAsSection("an") )
#--> [ 4, 5 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
FindPrevious(pcSub, nFrom): mirror of NextOccurrence -- highest position strictly before nFrom. 6 exemples exécutés
o1 = new stzString("[••[•[••]•[•]]••[••]]")
? o1.FindNext("[", :StartingAt = 17)
? o1.FindPrevious("]", :StartingAt = 13)
#--> 0
#--> 9
test de la bibliothèqueaucune extension
The position of the nth occurrence STRICTLY BEFORE the given position. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindPreviousNth(2, "an", 5)
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
ExtractNumbers
ExtractNumbers(): every contiguous run of digits as a list of numbers. e.g. "abc12def345" -> [12, 345].aucune extension
LeftCharRemoved
LeftCharRemoved / RightCharRemoved: non-mutating singular.
exemple composé
o1 = new stzString("banana split")
? o1.LeftCharRemoved()
#--> anana split
composé à partir de la signature, exécuté pour cette page
aucune extension
RightCharRemoved
A copy with the last (rightmost) char removed.
exemple composé
o1 = new stzString("banana split")
? o1.RightCharRemoved()
#--> banana spli
composé à partir de la signature, exécuté pour cette page
aucune extension
CapitalCased(): first char uppercase, rest lowercase. CapitalCased(): TITLE case -- capitalise the first letter of EVERY word (engine ToTitle), per the original. (NOT sentence-case / first-letter-only.) 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.CapitalCased()
#--> Banana Split
composé à partir de la signature, exécuté pour cette page
aucune extension
CapitalCase
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
#--> 1
test de la bibliothèqueaucune extension
IsMadeOfLetters
TRUE if the string is made of letters only.
exemple composé
o1 = new stzString("banana split")
? o1.IsMadeOfLetters()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
SplitToPartsOfSizes
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és
o1 = new stzString("999999999999")
o1.UpdateWith("999 999 999.999")
# the content becomes the new value
? o1.Content()
#--> 999 999 999.999
test de la bibliothèqueQCSXTZZZIBWU
RemoveCharFromLeft(pcChar): drop leading chars matching pcChar. 1 exemples exécutésQCSXTZZZIBWU
RemoveCharFromRight
Drop the trailing chars matching pcChar from the end of the string (mutating).QCSXTZZZIBWU
NthAsSection
ItemsAndTheirNumberOfOccurrence(): per-char occurrence count returned as [ [char, count], ... ]. NthAsSection(n, pcSub): [start, end] of the n-th occurrence of pcSub.
exemple composé
o1 = new stzString("banana split")
? @@( o1.NthAsSection(2, "an") )
#--> [ 4, 5 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
LeftBound
The opening (left) bound of the string.
exemple composé
o1 = new stzString("banana split")
? o1.LeftBound()
#--> b
composé à partir de la signature, exécuté pour cette page
aucune extension
RightBound
The closing (right) bound of the string.
exemple composé
o1 = new stzString("banana split")
? o1.RightBound()
#--> t
composé à partir de la signature, exécuté pour cette page
aucune extension
CharsInverted
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 extension
InvertCharsCase
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 is a contiguous list in normal form (1:5 style). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsContiguousListInNormalForm()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string is a contiguous list in short form. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsContiguousListInShortForm()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string holds a contiguous list, any form. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsContiguousListInString()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ItemsAndTheirNumberOfOccurrence
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 extension
Last3CharsAsString
The last three chars, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.Last3CharsAsString()
#--> lit
composé à partir de la signature, exécuté pour cette page
aucune extension
First3CharsAsString
The first three chars, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.First3CharsAsString()
#--> ban
composé à partir de la signature, exécuté pour cette page
aucune extension
Next3Chars
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 extension
CharRemovedFromLeft
CharRemovedFromLeft / FromRight: non-mutating singular form. Accepts a one-arg call (param ignored) for narrative-friendly spellings like CharRemovedFromLeft("*"). CharRemovedFromLeft(c): drop ONE leading char ONLY if it equals c (no-op when c is absent). Non-mutating. The XT form strips the whole run.QCSXTZZZIBWU
CharRemovedFromRight
A copy with the trailing run of the given char dropped.QCSXTZZZIBWU
Consecutive (adjacent) substrings, per the original monolith: for each length i in 1..floor(n/2), the string is tiled from each of the i phase offsets into i-char windows (phase-major order). Across all phases that yields every window of length i, so the count per length is n-i+1 and the total is Sum(n-i+1). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStrings()
#--> 57
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfConsecutiveSubStringsOf
How many CONSECUTIVE repetitions of pcSub the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStringsOf("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
ENGINE-BACKED (StzEngineStringConsecutiveSubStrings): all window tilings 1..floor(len/2). Retires the O(len^2) Haro double-loop. 2 exemples exécutés
oA = new stzString("a")
s = new stzString( oA.Repeated(1000) )
# ConsecutiveSubStrings count is 375,250
? len(s.ConsecutiveSubStrings())
# FindDupSecutiveChars is 999 (positions 2..1000)
? len(s.FindDupSecutiveChars())
#--> 375250
#--> 999
test de la bibliothèqueQCSXTZZZIBWU
FindConsecutiveSubStrings
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
QCSXTZZZIBWU
Same as ShortenedXT: ShortenedXT(nLeft, nRight, pcEllipsis): keep nLeft chars from the start and nRight from the end, with pcEllipsis between. A 0 left count mirrors the right (the symmetric default). 1 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 {...} 54321
test de la bibliothèqueaucune extension
BoundsRemoved(): drop the auto-detected leading + trailing non-letter bounds. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.BoundsRemoved()
#--> anana spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
NumberOfConsecutiveSubStringsOfNChars
How many consecutive n-char chunks the string splits into.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfConsecutiveSubStringsOfNChars(2)
#--> 11
composé à partir de la signature, exécuté pour cette page
aucune extension
Unspacify(): trim, then collapse each run of 2+ spaces to one (the original monolith: Trim + remove dup-consecutive spaces). 1 exemples exécutés
o1 = new stzString(" so ftan   za ")
o1.Unspacify()
# edges trimmed, the 3-space run collapsed
? o1.Content()
#--> so ftan za
test de la bibliothèqueQCSXTZZZIBWU
A 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 g
test de la bibliothèqueaucune extension
The position of the nth occurrence of pcSub after the given position (0 when there is none). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindNthNext(2, "an", 5)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
FindNthPrevious / FindNthNext on stzString. 3 exemples exécutés
o1 = new stzString("12♥4♥67")
# previous from 5
? o1.FindPrevious("♥", :StartingAt = 5)
# 2nd previous from 6
? o1.FindNthPrevious(2, "♥", :StartingAt = 6)
#--> 3
#--> 3
test de la bibliothèqueaucune extension
FirstZ
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
QCSXTZZZIBWU
LastZ
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 extension
VizFind / 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èqueQCSXTZZZIBWUMany
ConsecutiveSubStringsOfNChars
SectionsOfSameItems already defined as method; expose as alias in case test calls a slightly different spelling. ConsecutiveSubStringsOfNChars(n) -- value form: the substrings (not just count) that appear consecutively. ConsecutiveSubStringsOfNChars(n): the n-char windows obtained by tiling the string from each of the n phase offsets (phase-major), per the original monolith. ENGINE-BACKED (StzEngineStringConsecutiveSubStringsOfN): phase-major window tiling of n codepoints. Retires the O(len) Haro double-loop.
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
QCSXTZZZIBWU
FindNthAsSection
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 extension
NthStz
NthStz(n[, pcSub, :StartingAt = N]): 1-arg : the n-th char wrapped in stzChar 3-arg : start position of n-th occurrence of pcSub, optionally from a given position
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 extension
FindNthSZZ
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 extension
FirstSTDZ
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
QCSXTZZZIBWU
CharsInSection
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 extension
ReplaceInSections
ReplaceInSections(aSections, pcOld, pcNew): apply Replace only inside the given sections. Walks sections descending so positions stay valid.QCSXTZZZIBWU
ReplaceCharsWXT(pcCondition, pcNewChar): replace every char matching the predicate with pcNewChar. Engine-backed walk. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.ReplaceCharsW("@char = 'a'", "AN")
? o1.Content()
#--> bANnANnAN split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceEachLeadingChar(pcNewChar): replace every leading run char with pcNewChar. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.ReplaceEachLeadingChar("AN")
? o1.Content()
#--> ANanana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Replace EACH char of the trailing run with the given char (mutating). 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.ReplaceEachTrailingChar("AN")
? o1.Content()
#--> banana spliAN
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as ReplaceEachLeadingChar: ReplaceEachLeadingChar(pcNewChar): replace every leading run char with pcNewChar. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.ReplaceEachLeadingAndTrailingChar("AN")
? o1.Content()
#--> ANanana spliAN
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceSubStringsWithMarquers
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceSubStringsWithMarkers
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 split
composé à partir de la signature, exécuté pour cette page
aucune extension
UnicodeDataAsStringEmpty
UnicodeDataAsString() and MarquersPositions(): missing globals called inside the test scripts. We make them top-level stubs so the R3 misses resolve. The full UnicodeDataAsString returns the entire Unicode database as a string (engine call); for now we return "" so the test load completes -- it's only used by perf-comparison narratives.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
QCSXTZZZIBWU
FindOccurrences
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)
#--> 4
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Next3CharsAsString
The three chars after the given position, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.Next3CharsAsString(3)
#--> ana
composé à partir de la signature, exécuté pour cette page
aucune extension
FirstStz
FirstStz / LastStz: the [sub, position] grouping of the first / last occurrence at or after :StartingAt (the S = starting-at family is forward-looking).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FirstStz("an", 2) )
#--> [ "an", 2 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
LastStz
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 extension
CharTrimmedFromLeft
Same as CharRemovedFromLeftXT: CharRemovedFromLeft / FromRight: non-mutating singular form. Accepts a one-arg call (param ignored) for narrative-friendly spellings like CharRemovedFromLeft("*"). CharRemovedFromLeft(c): drop ONE leading char ONLY if it equals c (no-op when c is absent). Non-mutating. The XT form strips the whole run. (extended form: takes an options list)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 extension
FindFirstSZZ
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 extension
FindTheseOccurrencesAsSections
The [start, end] sections of the chosen occurrence numbers (:Of = sub).QCSXTZZZIBWUSTD
TheseSubstringsZ
TheseSubstringsZ(pacSubStr): start positions of any listed substring's first occurrence. TheseSubstringsZ([subs]): each substring grouped with ALL its positions -- [ [sub, [positions]], ... ].
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
QCSXTZZZIBWU
SplitAroundCS_named
(FindAntiSectionsZZ already exists earlier; the FindExceptZZ helper above covers the gap-sections semantic.) SplitAroundCS(pcSub, pCaseSensitive): like SplitAround but tolerant of named-param :CS = bCase.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
#--> 1
test de la bibliothèqueaucune extension
IsIsBoundedByNamedParam
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és
o1 = new stzString("125.450")
o1.RemoveNthChar(7)
# the 7th char is gone
? o1.Content()
#--> 125.45
test de la bibliothèqueQCSXTZZZIBWU
AntiFind
Antifind on stzString: synonyms of AntiFindAsSections / AntiFind. AntiFind(pcSub) here returns the positions of every char that is NOT inside pcSub's occurrences -- the complement walk.
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
QCSXTZZZIBWU
SplitAroundCSNamed
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és
exemple 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és
exemple composé
o1 = new stzString("banana split")
? @@( o1.SubStringsOccurringOnlyNTimes(2) )
#--> [ "an", "n", "na" ]
composé à partir de la signature, exécuté pour cette page
aucune extension
YieldCharsW(pcYielder, pNamedWhere): transform every char through the yielder expression via the engine char-map (StzEngineStringMapChars, expr.zig -- no eval). Optional :Where = predicate restricts to the matching chars first (engine FindCharsW). @char binding. Replaces the retired raw-eval YieldCharsWXT. 1 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 extension
SplitToPartsOfNChars
SplitToPartsOfNChars(n): split into pieces of EXACTLY n chars -- a shorter trailing remainder is DROPPED (the XT form keeps it).aussi écrite: SplitToPartsOfExactlyNChars
exemple 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
QCSXTZZZIBWU
NextNChars
PreviousNChars / NextNChars: the n chars before / after the first occurrence of a delimiter substring.aussi écrite: NextNItems
exemple composé
o1 = new stzString("banana split")
? o1.NextNChars("an", 2)
#--> an
composé à partir de la signature, exécuté pour cette page
aucune extension
PreviousNChars
The n chars before the given anchor (position or substring).aussi écrite: PreviousNItems
exemple composé
o1 = new stzString("banana split")
? o1.PreviousNChars("an", 2)
#--> b
composé à partir de la signature, exécuté pour cette page
aucune extension
FindNumbers
FindNumbers(): start positions of every (sign- and decimal-aware) number -- derived from the same sections Numbers() uses.QCSXTZZZIBWU
UniqueNumbers
UniqueNumbers(): the distinct numbers in the content. Uses Numbers() (NOT ExtractNumbers, which now mutates by removing them).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 extension
SubStringsOccurringNTimes
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 extension
NumbrifyQ
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és
exemple composé
o1 = new stzString("banana split")
? o1.StartsWithThisNumber("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
SplitToPartsOfNCharsXTOpt
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 extension
NumbersAndTheirPositions
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")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsNotLetter() -- 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
#--> 1
test de la bibliothèqueaucune extension
IsAtCharsNamedParam
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 extension
IsPluralOfThisStzType(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
#--> 1
test de la bibliothèqueaucune extension
InfereMethod(:From = :stzClass): infer the predicate method the given class offers for THIS string -- "is" + string, else "is" + string-minus-final-s (per the original monolith). E.g. Q("punctuation").InfereMethod(:From = :stzChar) -> "ispunctuation". 1 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
#--> ispunctuation
test de la bibliothèqueaucune extension
DuplicatedCharsRemoved
A copy with the duplicated chars removed; the original is unchanged.
exemple composé
o1 = new stzString("banana split")
? o1.DuplicatedCharsRemoved()
#--> ban split
composé à partir de la signature, exécuté pour cette page
aucune extension
A 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
#--> 1
test 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 extension
IsAFunction: 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
#--> 1
test 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 extension
IsAnInteger
TRUE if the string is an integer literal (trimmed).aussi écrite: IsInteger
exemple composé
o1 = new stzString("banana split")
? o1.IsAnInteger()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
FindSpaces
FindSpaces() / FindEmptyStrings(): positions of every " ".aussi écrite: FindEmptyStrings
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindSpaces() )
#--> [ 7 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
Check([pcExpr]) -- evaluate pcExpr per char (@char in scope) and return TRUE if it holds for every char. 0-arg form is the existence-check stub used by re-include narratives. 2 exemples exécutés
? Q("(,,)").Check(:That = 'StzCharQ(@Char).IsPunctuation()')
#--> 1
test de la bibliothèqueaucune extension
SubStringsOccurringLessThanNTimes
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 split
composé à partir de la signature, exécuté pour cette page
aucune extension
IsBoundOfXT
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)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsAClass(): 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
#--> 1
test 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 extension
Combinations
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
AreBoundsOfXT
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)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RandomPositionAfter
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és
exemple composé
o1 = new stzString("banana split")
? o1.ContainsMoreThenN("an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsMoreThanN
TRUE if pcSub occurs MORE than n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsMoreThanN("an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsAtLeastN
TRUE if pcSub occurs at least n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsAtLeastN("an", 2)
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsExactlyN
TRUE if pcSub occurs exactly n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsExactlyN("an", 2)
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
IsMarquer
IsMarquer / IsMarker: TRUE iff content is a "#N" marker token.aussi écrite: IsMarker
exemple composé
o1 = new stzString("banana split")
? o1.IsMarquer()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfEmptyLines
NumberOfEmptyLines(): count blank lines (after trim).
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfEmptyLines()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfNonEmptyLines
How many non-empty lines the string holds.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfNonEmptyLines()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
BoundsUpToNChars
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és
exemple composé
o1 = new stzString("banana split")
o1.Move(2, 5)
? o1.Content()
#--> bnaana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Swap(n1, n2): swap chars at positions n1 and n2. Also accepts Swap(:Positions = n1, :And = n2) and Swap(pcA, :And = pcB) to swap two substrings. 2 exemples exécutés
o1 = new stzString("TWO, ONE, THREE!")
o1.Swap("TWO", :And = "ONE")
# the words traded places
? o1.Content()
#--> ONE, TWO, THREE!
test de la bibliothèqueQCSXTZZZIBWU
NthToLast(n): the n-th-to-last char ("1st to last" = last). NthToLast(n): the char at position len - n (the original: CharAtPosition(NumberOfChars() - n)). 1 exemples exécutés
# SOFTANZA's 3rd-to-last is A
? Q("SOFTANZA").NthToLast(3)
#--> A
test de la bibliothèqueaucune extension
IsListInNormalForm(): TRUE iff content parses as a Haro list literal in normal form (square-bracketed, comma-separated). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsListInNormalForm()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
UniqueSubStringsBoundedBy
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: FindPositions
exemple composé
o1 = new stzString("banana split")
? @@( o1.Positions("an") )
#--> [ 2, 4 ]
composé à partir de la signature, exécuté pour cette page
aucune extension
FindNthBoundedBy
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")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Ranges
Ranges([aRanges]): contiguous-character ranges, or section-text extraction when given a list of [start, count] ranges. Test 543: o1.Ranges([[1,2],[8,3],...]) -> sliced sections.
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 extension
RemoveBoundedSubString(pacBounds): remove the entire bounded section (including bounds) of the FIRST match. RemoveBoundedSubString(pcSub): remove the BOUNDED occurrences of pcSub (their content only -- the bounds stay); a 2-list keeps the legacy remove-first-region-with-bounds behavior. 1 exemples exécutés
o1 = new stzString("bla word bla <<word>> bla bla <<word>> bla <<word>> word")
o1.RemoveBoundedSubString("word")
# only the bounded contents vanish
? o1.Content()
#--> bla word bla <<>> bla bla <<>> bla <<>> word
test de la bibliothèqueQCSXTZZZIBWU
RemoveAnySubStringBoundedBy: remove every bounded region's CONTENT (the bounds stay); the IB form removes bounds too. 2 exemples exécutés
o1 = 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èqueQCSXTZZZIBWU
SubStringBounds
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
QCSXTZZZIBWU
FindTheseSubStringBounds
FindTheseSubStringBounds(pcSub|pacSubStr [, pacBounds]): - 1-arg list: per substring, the [before, after] single-char bounds - 2-arg (string, list): the bounds of pcSub when found inside any of the explicit pacBounds [open, close] pair FindTheseSubStringBounds(pcSub, [open, close]): the FLAT start positions of the open/close tokens IMMEDIATELY around each occurrence of pcSub (only exactly-bounded occurrences count).QCSXTZZZIBWU
IsRightToLeft
NRightCharsAsSubString(n) / NLeftCharsAsSubString(n). For a right-to-left string the VISUAL right is the string START (per the original NRightCharsAsSubString: IsRightToLeft -> the leading codepoints).
exemple composé
o1 = new stzString("banana split")
? o1.IsRightToLeft()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The n rightmost chars, direction-aware, as a string. 1 exemples exécutés
o1 = 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 extension
NLeftCharsAsSubString
The n leftmost chars, direction-aware, as a string.
exemple composé
o1 = new stzString("banana split")
? o1.NLeftCharsAsSubString(2)
#--> ba
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveNthOccurrence(n, pcSub): remove the n-th occurrence of pcSub. RemoveNthOccurrence(n, pcSub): remove the n-th occurrence of pcSub; n may be the symbols :First / :Last. 2 exemples exécutés
o1 = new stzString("**A1****A2***A3")
o1.RemoveNthOccurrence(:Last, "A")
# the third A is gone
? o1.Content()
#--> **A1****A2***3
test de la bibliothèqueQCSXTZZZIBWU
AddBounds([pcOpen, pcClose]): wrap content with bounds. 1-arg list form accepted: AddBounds(["<<", ">>"]). 1 exemples exécutés
o1 = new stzString("word")
o1.AddBounds(["<<",">>"])
# bounded
? o1.Content()
#--> <<word>>
test de la bibliothèqueQCSXTZZZIBWU
BoundWith
Same as AddBounds: AddBounds([pcOpen, pcClose]): wrap content with bounds. 1-arg list form accepted: AddBounds(["<<", ">>"]).QCSXTZZZIBWU
Same as BeginsWithOneOfTheseCS: (FirstBoundsOf / LastBoundsOf live next to BoundsOf above.) BeginsWithOneOfTheseCS(pacSubStr, pCaseSensitive): TRUE if the content starts with any of the listed substrings. 1 exemples exécutésaussi écrite: StartsWithOneOfThese
exemple composé
o1 = new stzString("banana split")
? o1.BeginsWithOneOfThese([ "an", "a" ])
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
StartsWithEither
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" ])
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
HasCentralChar(): TRUE iff content length is odd. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HasCentralChar()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The middle char of the string (odd lengths). 1 exemples exécutésaucune extension
IsMultipleOf(pcUnit): TRUE iff content is pcUnit repeated. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsMultipleOf("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Marquer
Marquer / Marker: the FIRST marker number. Marquer(): the marquer SYMBOL itself.aussi écrite: Marker
exemple composé
o1 = new stzString("banana split")
? o1.Marquer()
#--> #
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsMarquers
TRUE if the string contains marquers.aussi écrite: ContainsMarkers
exemple composé
o1 = new stzString("banana split")
? o1.ContainsMarquers()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsIncludedIn
TRUE if the string occurs inside the given one.aussi écrite: IncludedIn
exemple composé
o1 = new stzString("banana split")
? o1.IsIncludedIn("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
ReplaceSubStringAtPositions
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Sort the marquers in descending order (mutating). 1 exemples exécutésaucune extension
SortMarkersInDescending
Same as SortMarquersInDescending: Sort the marquers in descending order (mutating).aucune extension
Sort the marquers in ascending order (mutating). 1 exemples exécutésaucune extension
SortMarkersInAscending
Same as SortMarquersInAscending: Sort the marquers in ascending order (mutating).aucune extension
MarquersSortedInDescendingZZ
MarquersSortedInDescendingZZ: the sorted marquers ZIPPED onto the text-order slots (the ZZ view of the would-be sorted string).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és
exemple composé
o1 = new stzString("banana split")
o1.RemoveChar(2)
? o1.Content()
#--> bnana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
A copy with the given char removed everywhere. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.CharRemoved(2)
#--> bnana split
composé à partir de la signature, exécuté pour cette page
aucune extension
Remove the char at position n only if it equals pcChar (mutating). 1 exemples exécutésQCSXTZZZIBWU
TRUE if the chars are in ascending order. 2 exemples exécutés
# is ascending
? Q("01233445679").IsSortedInAscending()
# not descending
? Q("01233445679").IsSortedInDescending()
#--> 1
#--> 0
test de la bibliothèqueaucune extension
TRUE if the chars are in descending order. 3 exemples exécutés
# is ascending
? Q("01233445679").IsSortedInAscending()
# not descending
? Q("01233445679").IsSortedInDescending()
#--> 1
#--> 0
test de la bibliothèqueaucune extension
RemoveManySections
Remove the chars of each given [start, end] section (mutating).QCSXTZZZIBWU
Replace the nth occurrence AFTER the given position (mutating). 1 exemples exécutés
o1 = new stzString( "----@@--@@-------@@----@@---")
o1.ReplaceNextNthOccurrence(2, :Of = "@@", :StartingAt = 12, :With = "##")
# the 2nd @@ after 12 became ##
? o1.Content()
#--> ----@@--@@-------@@----##---
test de la bibliothèqueQCSXTZZZIBWU
Replace the nth occurrence BEFORE the given position (mutating). 1 exemples exécutés
o1 = new stzString( "----@@--@@-------@@----@@---")
o1.ReplacePreviousNthOccurrence(2, :Of = "@@", :StartingAt = 22, :With = "##")
# the 2nd @@ before 22 became ##
? o1.Content()
#--> ----@@--##-------@@----@@---
test de la bibliothèqueQCSXTZZZIBWU
TRUE 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
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
TRUE if the string is the uppercase form of the given one. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsUppercaseOf("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
UppercasedInLocale
UppercasedInLocale / LowercasedInLocale -- locale-neutral fallback.
exemple composé
o1 = new stzString("banana split")
? o1.UppercasedInLocale("an")
#--> BANANA SPLIT
composé à partir de la signature, exécuté pour cette page
aucune extension
The 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
#--> 0
test de la bibliothèqueaucune extension
The case of the single-char string (codepoint-aware). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.CharCase()
#--> mixed
composé à partir de la signature, exécuté pour cette page
aucune extension
CountInSections
How many occurrences of pcSub fall inside the given sections.aussi écrite: NumberOfOccurrencesInSections
exemple composé
o1 = new stzString("banana split")
? o1.CountInSections("an", [ "an", "a" ])
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Splits
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
QCSXTZZZIBWU
RemoveRanges
Remove the chars of each given [start, range] slice (mutating).QCSXTZZZIBWU
RemoveTheseSubStringBounds
RemoveTheseSubStringBounds(pcSub, pacBounds): strip the bounds surrounding every occurrence of pcSub inside the bounded regions.
exemple composé
o1 = new stzString("banana split")
o1.RemoveTheseSubStringBounds("an", [ "an", "a" ])
? o1.Content()
#--> ban split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
WalkForwardW
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 extension
FindWords
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 extension
HasThisTrailingChar
Same as HasThisTrailingCharCS: HasThisTrailingChar(pcChar, pCS): TRUE iff content ends with a run of pcChar. (Distinct from HasTrailingChars() which is the 0-arg "has any trailing run" predicate above.)
exemple composé
o1 = new stzString("banana split")
? o1.HasThisTrailingChar("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
HasThisLeadingChar
Same as HasThisLeadingCharCS: TRUE if the string starts with the given char.
exemple composé
o1 = new stzString("banana split")
? o1.HasThisLeadingChar("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FindTrailingChars
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
QCSXTZZZIBWU
FindLeadingChars
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
QCSXTZZZIBWU
TRUE if the last char equals the given one. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.TrailingCharIs("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
LeadingCharIs
TRUE if the first char equals the given one.
exemple composé
o1 = new stzString("banana split")
? o1.LeadingCharIs("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
PositionOfCentralChar: position of the center char (0 if even). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.PositionOfCentralChar()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsNTimesMultipleOf(n, pcUnit): TRUE iff content is pcUnit repeated exactly n times. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsNTimesMultipleOf(2, "an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
MarkSubStringsCS
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasLeadingSubString
TRUE if the string has a leading repeated-char run.
exemple composé
o1 = new stzString("banana split")
? o1.HasLeadingSubString()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasTrailingSubStringOf
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")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
HasLeadingSubStringOf
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")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TrailingSubStringZZOf
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 extension
The position of the first marquer. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindFirstMarquer()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The nth marquer of the string. 1 exemples exécutésaussi écrite: NthMarker
o1 = new stzString("My name is #1, my age is #2, and my job is #3. Again: my name is #1!")
# the marquer
? o1.NthMarquer(2)
# its position
? o1.FindNthMarquer(2)
#--> #2
#--> 26
test de la bibliothèqueaucune extension
The position of the nth marquer. 1 exemples exécutés
o1 = new stzString("My name is #1, my age is #2, and my job is #3. Again: my name is #1!")
# the marquer
? o1.NthMarquer(2)
# its position
? o1.FindNthMarquer(2)
#--> #2
#--> 26
test de la bibliothèqueaucune extension
The last marquer of the string. 1 exemples exécutésaucune extension
The position of the last marquer. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindLastMarquer()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The nth marquer after the given position. 1 exemples exécutés
o1 = new stzString("My name is #1, my age is #2, and my job is #3. Again: my name is #1!")
# the marquer
? o1.NextNthMarquerST(2, :StartingAt = 14)
# its position
? o1.FindNextNthMarquerST(2, :StartingAt = 14)
#--> #3
#--> 44
test de la bibliothèqueaucune extension
PreviousMarquers
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 · FindPreviousNthMarquer
exemple composé
o1 = new stzString("banana split")
? o1.FindNthPreviousMarquer(2, 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
FindMarquersAsSections
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
MarquersSortedZ
MarquersSortedZ/ZZ: the ASCENDING-sorted marquers zipped onto the text-order positions / sections.aussi écrite: MarkersSortedZQCSXTZZZIBWU
MarquerByPosition
The marquer covering the given position.aussi écrite: MarkerByPositionaucune extension
PreviousMarquerZ
PreviousMarquerZ: the nearest previous marquer with its position.aussi écrite: PreviousMarkerZaucune extension
MarquersSortedUZ
MarquersSortedUZ: the unique marquers sorted by NUMBER, each with its own positions.aussi écrite: MarkersSortedUZQCSXTZZZIBWU
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
#--> 1
test de la bibliothèqueaucune extension
ToListInShortForm(): render the hosted list in the short range syntax -- "1 : 3" for numbers, '"A" : "D"' for strings. 1 exemples exécutésaussi écrite: ToListInStringSF
exemple composé
o1 = new stzString("banana split")
? o1.ToListInShortForm()
#--> "b" : "t"
composé à partir de la signature, exécuté pour cette page
aucune extension
FindNextOccurrence
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)
#--> 4
composé à partir de la signature, exécuté pour cette page
aucune extension
UnicodesPerChar
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 extension
UnicodeOfChar
The codepoint of the given char.
exemple composé
o1 = new stzString("banana split")
? o1.UnicodeOfChar("a")
#--> 97
composé à partir de la signature, exécuté pour cette page
aucune extension
Turn the content into its hex digest with the given algorithm (mutating, engine-backed). 1 exemples exécutésaussi nommée: digest checksum sha md5 fingerprint
o1 = new stzString("original text before hashing")
o1.Hash(:MD5)
# the md5 hex digest
? o1.Content()
#--> 8ffad81de2e13a7b68c7858e4d60e263
test de la bibliothèqueQCSXTZZZIBWU
Hashed
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 · EachCharBoxedRoundedDashed
exemple 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
QCSXTZZZIBWU
TitlecasedInLocale
The string titlecased for the given locale (falls back to plain titlecase).
exemple composé
o1 = new stzString("banana split")
? o1.TitlecasedInLocale("an")
#--> Banana Split
composé à partir de la signature, exécuté pour cette page
aucune extension
CapitalisedInLocale
Same as Titlecased: The string in Title Case (each word capitalized).
exemple composé
o1 = new stzString("banana split")
? o1.CapitalisedInLocale("an")
#--> Banana Split
composé à partir de la signature, exécuté pour cette page
aucune extension
CapitalizedInLocale
Same as Titlecased: The string in Title Case (each word capitalized).
exemple composé
o1 = new stzString("banana split")
? o1.CapitalizedInLocale("an")
#--> Banana Split
composé à partir de la signature, exécuté pour cette page
aucune extension
FindPreviousOccurrence
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)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ToListInNormalForm(): the hosted list rendered in normal bracketed form (whatever syntax hosted it -- short ranges included). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ToListInNormalForm()
#--> [ "b", "a", "n", "a", "n", "a", " ", "s", "p", "l", "i", "t" ]
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfLeadingItems
How long the leading char run is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLeadingItems()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
NumberOfTrailingItems
How long the trailing char run is.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfTrailingItems()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveRightOccurrence
Remove the LAST occurrence of pcSub (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveRightOccurrence("an")
? o1.Content()
#--> bana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsHybridOrientation
TRUE if the content mixes LTR (Latin) and RTL (Arabic-side) scripts.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsHybridOrientation()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Which abbreviation form the language string carries (:Short / :Long). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.LanguageAbbreviationForm()
#--> unknown
composé à partir de la signature, exécuté pour cette page
aucune extension
RepresentsSignedRealNumber
TRUE if the string is a SIGNED real-number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsSignedRealNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RepresentsUnsignedRealNumber
TRUE if the string is an UNSIGNED real-number literal.
exemple composé
o1 = new stzString("banana split")
? o1.RepresentsUnsignedRealNumber()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if the string is a 3-letter (long) language abbreviation (ISO 639-2/3). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsLongLanguageAbbreviation()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveLeadingAndTrailingChars()
? o1.Content()
#--> anana spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
SubStringComesBetween is order-INDEPENDENT (matches the original): TRUE if pcSub sits between the two bounds in EITHER order. 1 exemples exécutés
o1 = new stzString("---♥♥...**---")
# '...' comes between ♥♥ and ** (in order)
? o1.SubStringComesBetween("...", "♥♥", "**")
# and order-independently between ** and ♥♥
? o1.SubStringComesBetween("...", "**", "♥♥")
#--> 1
#--> 1
test de la bibliothèqueaucune extension
TRUE if pcSub occurs BEFORE pcOther (a substring, or :Position = n). 1 exemples exécutésaussi écrite: SubStringComesBeforeSubString
exemple composé
o1 = new stzString("banana split")
? o1.SubStringComesBefore("an", "an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if pcSub occurs AFTER pcOther (a substring, or :Position = n). 1 exemples exécutésaussi écrite: SubStringComesAfterSubString
exemple composé
o1 = new stzString("banana split")
? o1.SubStringComesAfter("an", "an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if pcSub occurs before the given position. 1 exemples exécutésaussi écrite: SubStringComesBeforePosition
exemple composé
o1 = new stzString("banana split")
? o1.SubStringComesBeforePos("an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if pcSub occurs after the given position. 1 exemples exécutésaussi écrite: SubStringComesAfterPosition
exemple composé
o1 = new stzString("banana split")
? o1.SubStringComesAfterPos("an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
TRUE if pcSub occurs between the two given positions. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.SubStringComesBetweenPositions("an", 2, 5)
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
InQ
Narrative-sub accessor used by SubStringQ(["sub", :In = "host"]). Stored as the LAST line of the wrapped content separated by char(1), so we don't need a class-level attribute that Haro would require declaring with the other @aContent slots. InQ(host): the host becomes the new content; the prior content is kept as the narrative sub.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 t
composé à 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")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ComesAfterSubString
Narrative form: TRUE if the chain's substring comes after the given one.
exemple composé
o1 = new stzString("banana split")
? o1.ComesAfterSubString("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ComesBetweenPositions
Narrative form: TRUE if the chain's substring lies between the two positions.
exemple composé
o1 = new stzString("banana split")
? o1.ComesBetweenPositions(2, 5)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ComesBeforePosition
Narrative form: TRUE if the chain's substring comes before the position.
exemple composé
o1 = new stzString("banana split")
? o1.ComesBeforePosition(2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
ComesAfterPosition
Narrative form: TRUE if the chain's substring comes after the position.
exemple composé
o1 = new stzString("banana split")
? o1.ComesAfterPosition(2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
SubStringComesBetweenSubStrings
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 extension
ToListInStringNF
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 extension
SectionBounds
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
QCSXTZZZIBWU
FirstNonSpaceChar
The first non-space char of the string.
exemple composé
o1 = new stzString("banana split")
? o1.FirstNonSpaceChar()
#--> b
composé à partir de la signature, exécuté pour cette page
aucune extension
LastNonSpaceChar
The last non-space char of the string.
exemple composé
o1 = new stzString("banana split")
? o1.LastNonSpaceChar()
#--> t
composé à partir de la signature, exécuté pour cette page
aucune extension
FirstNonSpaceCharPosition
The position of the first non-space char.aussi écrite: FindFirstNonSpaceChar
exemple composé
o1 = new stzString("banana split")
? o1.FirstNonSpaceCharPosition()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
LastNonSpaceCharPosition
The position of the last non-space char.aussi écrite: FindLastNonSpaceChar
exemple composé
o1 = new stzString("banana split")
? o1.LastNonSpaceCharPosition()
#--> 12
composé à partir de la signature, exécuté pour cette page
aucune extension
StringsW
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: MultipliedByNQCSXTZZZIBWU
Divide every number inside the string by n (mutating). 2 exemples exécutésQCSXTZZZIBWU
Add n to every number inside the string (mutating). 2 exemples exécutésQCSXTZZZIBWU
Subtract n from every number inside the string (mutating). 2 exemples exécutésQCSXTZZZIBWU
SubtractN
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 inject
exemple composé
o1 = new stzString("banana split")
o1.Insert("an", 2)
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
WalkUntil
Walk the chars forward: the position where the condition first holds.
exemple composé
o1 = new stzString("banana split")
? o1.WalkUntil("@char = 'a'")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
EachCharBoxedDashed
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 extension
The string as boxed char cells with the occurrences of pcSub visually marked (the VizFind map, boxed). 1 exemples exécutés
o1 = new stzString("..STZ..StZ..stz...STZ")
# bullets at 3, 8, 13 and 19
? o1.VizFindBoxedCSXT("STZ", :CS = FALSE, [ :Numbered = TRUE ])
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ . │ . │ S │ T │ Z │ . │ . │ S │ t │ Z │ . │ . │ s │ t │ z │ . │ . │ . │ S │ T │ Z │
#--> └───┴───┴─•─┴───┴───┴───┴───┴─•─┴───┴───┴───┴───┴─•─┴───┴───┴───┴───┴───┴─•─┴───┴───┘
test de la bibliothèqueQCSXTZZZIBWU
VizFindBoxedRounded
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
FindSSZ
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
QCSXTZZZIBWU
Replace the substring at each given position with its counterpart in the new list (mutating). 1 exemples exécutés
o1 = new stzString("--[...]---[...]---[...]---[~~~]--[~~~]--")
o1.ReplaceSubStringAtPositionsByMany([ 27, 34 ], "[~~~]", [ "bbb", "aaa" ])
# each got its own name
? o1.Content()
#--> --[...]---[...]---[...]---bbb--aaa--
test de la bibliothèqueaucune extension
ToListInString(): the hosted list rendered in normal form (@@). 1 exemples exécutés
exemple 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 extension
LanguageAbbreviationFor
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
QCSXTZZZIBWU
SplitAroundSubStrings
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
QCSXTZZZIBWU
SplitAroundSection
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és
o1 = new stzString("12500;NAME;10;0")
# the next one from 1
? o1.NextOccurrence( :Of = ";", :StartingAt = 1 )
# the 2nd from 5
? o1.NextNthOccurrence( 2, :Of = ";", :StartingAt = 5)
#--> 6
#--> 11
test de la bibliothèqueaucune extension
An ascending-sorted copy of the chars; the original is unchanged. 2 exemples exécutés
o1 = new stzString("73964532041")
# ascending
? o1.SortedInAscending()
# descending
? o1.SortedInDescending()
#--> 01233445679
#--> 97654433210
test de la bibliothèqueaucune extension
A descending-sorted copy of the chars; the original is unchanged. 2 exemples exécutés
o1 = new stzString("73964532041")
# ascending
? o1.SortedInAscending()
# descending
? o1.SortedInDescending()
#--> 01233445679
#--> 97654433210
test de la bibliothèqueaucune extension
TRUE if the chars are sorted, ascending OR descending. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsSorted()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The sorting order of the chars (:Ascending, :Descending, ...). 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.SortingOrder()
#--> unsorted
composé à partir de la signature, exécuté pour cette page
aucune extension
Sort the CHARS of the string in ascending order in place (mutating). For a copy, use Sorted. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.Sort()
? o1.Content()
#--> aaabilnnpst
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
SortInAscending
Sort the chars in ascending order in place (mutating).
exemple composé
o1 = new stzString("banana split")
o1.SortInAscending()
? o1.Content()
#--> aaabilnnpst
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
SortInDescending
Sort the chars of the string in descending order in place (mutating).
exemple composé
o1 = new stzString("banana split")
o1.SortInDescending()
? o1.Content()
#--> tspnnlibaaa
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
LeadingSubStringRemove
Same as RemoveLeadingChars: RemoveLeadingChars / RemoveTrailingChars / RemoveBoundingChars: strip every leading (or trailing, or both) char that matches the first (resp. last) char of the current content. Equivalent to the "trim run" interpretation in narrative tests.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 split
composé à partir de la signature, exécuté pour cette page
aucune extension
A copy with the leading char run removed. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.LeadingCharsRemoved()
#--> anana split
composé à partir de la signature, exécuté pour cette page
aucune extension
TrailingCharsRemoved
A copy with the trailing char run removed.
exemple composé
o1 = new stzString("banana split")
? o1.TrailingCharsRemoved()
#--> banana spli
composé à partir de la signature, exécuté pour cette page
aucune extension
Remove the first n chars (mutating). 1 exemples exécutés
o1 = new stzString("123BATISTA")
o1.RemoveNFirstChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("123BATISTA").FirstNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
test de la bibliothèqueQCSXTZZZIBWU
Remove the last n chars (mutating). 1 exemples exécutés
o1 = new stzString("BATISTA123")
o1.RemoveNLastChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA123").LastNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
test de la bibliothèqueQCSXTZZZIBWU
BeginsWith(pcSub): TRUE iff content starts with pcSub. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.BeginsWith("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
The position of the nth occurrence of pcSub after the given position. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.FindNextNthOccurrence(2, "an", 5)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The position of the nth occurrence before the given position. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.NthPreviousOccurrence(2, "an", 5)
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
FindPreviousNthOccurrence(n, :Of = sub, :StartingAt = pos): position of -- the n-th occurrence of sub BEFORE pos (0 if none). FindFirstPrevious / -- FindFirstNext are the n=1 shorthands. The nth occurrence of the substring from the given start position: the position(s). 1 exemples exécutésaussi écrite: FindPreviousNthOccurrenceOf
exemple composé
o1 = new stzString("banana split")
? o1.FindPreviousNthOccurrence(2, "an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The first occurrence of the substring from the given start position: the position(s). 1 exemples exécutésaussi écrite: FindFirstPreviousOccurrence
exemple composé
o1 = new stzString("banana split")
? o1.FindFirstPrevious("an", 2)
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
The first occurrence of the substring from the given start position: the position(s). 1 exemples exécutésaussi écrite: FindFirstNextOccurrence
exemple composé
o1 = new stzString("banana split")
? o1.FindFirstNext("an", 2)
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
The distance in chars from the given position to the target. 2 exemples exécutés
o1 = new stzString("---456---")
# the exclusive gap
? o1.DistanceTo("6", :StartingAt = 4)
# the inclusive XT distance
? o1.DistanceToXT("6", :StartingAt = 4)
#--> 1
#--> 3
test de la bibliothèqueQCSXTZZZIBWUST
ContainsTheLetters(pacLetters): TRUE iff content contains every letter in pacLetters (in any order). 1 exemples exécutés
o1 = new stzString("Adoption of the plan B")
# contains the letters N and b
? o1.ContainsTheLetters([ "N", "b" ])
#--> 1
test de la bibliothèqueaucune extension
FindSubStringBetween
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
QCSXTZZZIBWU
ContainsNoOneOfThese(paSubStr): TRUE iff content contains NONE of the listed substrings. 1 exemples exécutésaussi écrite: ContainsNoneOfThese
o1 = new stzString("abcdef")
# none present
? o1.ContainsNoOneOfThese([ "xy", "xyz", "mwb" ])
# de spoils it
? o1.ContainsNoOneOfThese([ "xy", "xyz", "de", "mwb" ])
#--> 1
#--> 0
test de la bibliothèqueaucune extension
IsLowercased / 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
#--> 1
test de la bibliothèqueaucune extension
TRUE 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
#--> 1
test de la bibliothèqueaucune extension
(IsLowercase / IsUppercase already exist earlier.) HasThisCentralChar(pcChar): TRUE iff the central char is pcChar. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.HasThisCentralChar("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
A copy with the last n chars removed. 1 exemples exécutésaussi écrite: NLastCharsRemoved
o1 = new stzString("BATISTA123")
o1.RemoveNLastChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("BATISTA123").LastNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
test de la bibliothèqueaucune extension
A copy with the first n chars removed. 1 exemples exécutésaussi écrite: NFirstCharsRemoved
o1 = new stzString("123BATISTA")
o1.RemoveNFirstChars(3)
# mutated in place
? o1.Content()
# or functionally
? StzStringQ("123BATISTA").FirstNCharsRemoved(3)
#--> BATISTA
#--> BATISTA
test de la bibliothèqueaucune extension
IsTitleCased: 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
#--> 1
test de la bibliothèqueaucune extension
ContainsLetters(): TRUE iff the content contains any letter. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsLetters()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
The 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 Programming
test de la bibliothèqueaucune extension
IsAlmostAFunctionCall(): 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
#--> 1
test de la bibliothèqueaucune extension
WalkBackwardW
WalkBackwardW(pcCondition | :StartingAt = N, :UntilBefore = expr): walk content backwards from a starting position; returns the first position where the :UntilBefore predicate is TRUE (named-param form), or all positions where pcCondition is TRUE (string form).
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 extension
ReplaceNthCharQ 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*nement
test de la bibliothèqueaucune extension
CharQ
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
QCSXTZZZIBWU
PartsAndPartitionersUsingXT
Each part zipped with its partitioner value (the expression's result for it).aussi écrite: Parts2Using
exemple 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
QCSXTZZZIBWU
ReplaceAllChars(pcOld, pcNew): char-by-char map. ReplaceAllChars: (:With = pcNew) : replace every char with pcNew Two-arg (pcOld, pcNew) form lives in ReplaceAllCharsXT. 1 exemples exécutés
o1 = new stzString("Use these two letters: س and ص.")
o1.ReplaceAllChars( :With = "*" )
# as many stars as chars
? o1.Content()
#--> *******************************
test de la bibliothèqueQCSXTZZZIBWU
How 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
#--> 4
test de la bibliothèqueaucune extension
NthSubStringAfterSplittingStringUsing(n, pcSep): the n-th piece after splitting on pcSep. 1 exemples exécutés
o1 = new stzString("abc;123;gafsa;ykj")
# via SplitQ
? o1.SplitQ(";").NthItem(3)
# via the long natural name
? o1.NthSubstringAfterSplittingStringUsing(3, ";")
#--> gafsa
#--> gafsa
test de la bibliothèqueaucune extension
Same as ContainsEachCS: ContainsEachCS(pacSubStr, pCaseSensitive): TRUE iff content contains every listed substring. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsEach([ "an", "a" ])
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ContainsEachOfThese
Same as ContainsEachCS: ContainsEachCS(pacSubStr, pCaseSensitive): TRUE iff content contains every listed substring.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsEachOfThese([ "an", "a" ])
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
MultiplyBy(n): repeat content n times. MultiplyBy(list): distribute -- "a" x ["b","c"] -> "ab" + "ac". 1 exemples exécutés
o1 = new stzString("a")
o1.MultiplyBy([ "b", "c", "d" ])
# ab + ac + ad
? o1.Content()
#--> abacad
test de la bibliothèqueQCSXTZZZIBWU
ReplaceFirstNChars
ReplaceFirstNChars(n, pcNew): replace the first n chars with pcNew.
exemple composé
o1 = new stzString("banana split")
o1.ReplaceFirstNChars(2, "AN")
? o1.Content()
#--> ANnana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceLastNChars
Replace the last n chars with the given string (mutating).
exemple composé
o1 = new stzString("banana split")
o1.ReplaceLastNChars(2, "AN")
? o1.Content()
#--> banana splAN
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReplaceNthOccurrence
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveFirstOccurrence(pcSub) -- accepts :Of = pcSub. 1 exemples exécutés
o1 = new stzString("LandRingoriaLand")
o1.RemoveFirstOccurrence( :Of = "Land")
# the trailing one stays
? o1.Content()
#--> RingoriaLand
test de la bibliothèqueQCSXTZZZIBWU
Orientation
Orientation(): :LTR for normal scripts, :RTL when first char is Arabic/Hebrew/etc.
exemple composé
o1 = new stzString("banana split")
? o1.Orientation()
#--> ltr
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveNLeftChars / RemoveNRightChars aliases. 2 exemples exécutés
o1 = new stzString("سلام لأهل مصر الكرام")
o1.RemoveNLeftChars(7)
# the head is gone, string-order
? o1.Content()
#--> هل مصر الكرام
test de la bibliothèqueQCSXTZZZIBWU
Same as RemoveNLastChars: Remove the last n chars (mutating). 1 exemples exécutés
o1 = new stzString("eeebxeTuniseee")
o1.RemoveNLeftChars(3)
o1.RemoveNRightChars(3)
# the middle remains
? o1.Content()
#--> bxeTunis
test de la bibliothèqueQCSXTZZZIBWU
Replace the occurrences of pcSub cycling through the given replacements (same as ReplaceByMany). 1 exemples exécutés
o1 = new stzString("--Ring--Softanza--")
o1.ReplaceWithMany("--", [ "1", "2", "3" ])
# the three '--' get 1, 2, 3
? o1.Content()
#--> 1Ring2Softanza3
test de la bibliothèqueQCSXTZZZIBWU
Replace each substring with its same-index counterpart (pairwise, mutating). 1 exemples exécutés
o1 = new stzString("--Ring__Softanza..")
o1.ReplaceManyWithMany([ "--", "__", ".." ], [ "1", "2", "3" ])
# -- / __ / .. become 1 / 2 / 3
? o1.Content()
#--> 1Ring2Softanza3
test de la bibliothèqueQCSXTZZZIBWU
AlignedXT(: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 extension
CompressUsingBinary(pcMask): keep the chars whose mask bit is "1", drop the "0" ones ("ABCDEFGH" x "10011011" -> "ADEGH"). 1 exemples exécutés
o1 = new stzString("ABCDEFGH")
o1.CompressUsingBinary("10011011")
# the 1-bits survive
? o1.Content()
#--> ADEGH
test de la bibliothèqueQCSXTZZZIBWU
Same as UnicodeCompareWithCS: UnicodeCompareWithCS(pcOther, pCaseSensitive): codepoint comparison. Returns :Less, :Equal or :Greater. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.UnicodeCompareWith("an")
#--> greater
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Locale-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é")
#--> greater
test de la bibliothèqueaucune extension
ContainsLetter(pcLetter): TRUE iff content contains pcLetter. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.ContainsLetter("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
ContainsBoth(pcA, pcB): TRUE iff content contains BOTH. 1 exemples exécutés
o1 = new stzString("ar_TN-tun")
# contains each of _ and -
? o1.ContainsEachCS([ "_", "-" ], TRUE)
# contains both
? o1.ContainsBoth("_", "-")
#--> 1
#--> 1
test de la bibliothèqueaucune extension
NumericValue
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
IsListInShortForm: rough check for `a:b` short-form list literal. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsListInShortForm()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsALetterOf(pcOther): TRUE iff single-char This appears in pcOther. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsALetterOf("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveLeftOccurrence
Same as RemoveFirstOccurrence: RemoveFirstOccurrence(pcSub) -- accepts :Of = pcSub.
exemple composé
o1 = new stzString("banana split")
o1.RemoveLeftOccurrence("an")
? o1.Content()
#--> bana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
NumberForm(): :Integer, :Decimal, :Hex, :Binary, or :Other. 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.NumberForm()
#--> other
composé à partir de la signature, exécuté pour cette page
aucune extension
PositionAfter
PositionAfter(pcSub): position right after first occurrence.
exemple composé
o1 = new stzString("banana split")
? o1.PositionAfter("an")
#--> 4
composé à partir de la signature, exécuté pour cette page
aucune extension
PositionBefore
The position just BEFORE the first occurrence of pcSub.
exemple composé
o1 = new stzString("banana split")
? o1.PositionBefore("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
InsertSubStrings(anPos, pacStr): insert pacStr[i] at anPos[i], processed from highest position down so earlier positions stay valid. 3 exemples exécutés
o1 = new stzString("All our software versions must be updated!")
o1.InsertSubStrings( o1.PositionAfter("versions"), [ "V1", "V2", "V3" ])
# parenthesized with padding spaces
? o1.Content()
#--> All our software versions (V1, V2, V3)  must be updated!
test de la bibliothèqueQCSXTZZZIBWU
ItemsWhere
Same as CharsW: (IsTitlecased -- Haro is case-insensitive, just one def.) CharsW(pcCondition): the characters where the predicate is TRUE (predicate-driven char filter).
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 extension
IsShortLanguageAbbreviation(): 2-letter ISO 639-1-style alpha code. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.IsShortLanguageAbbreviation()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsLatin(): TRUE iff every char is ASCII-Latin. 1 exemples exécutés
# Latin script
? StzStringQ("Ⅱ").IsLatin()
# and a Roman number
? StzCharQ("Ⅱ").IsRomanNumber()
#--> 1
#--> 1
test de la bibliothèqueaucune extension
ContainsNOccurrences
TRUE if pcSub occurs exactly n times.
exemple composé
o1 = new stzString("banana split")
? o1.ContainsNOccurrences(2, "an")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
EXTRACT the digits as one string ("number 125" -> "125"). 1 exemples exécutésaussi écrite: OnlyDigits
# digits only
? Q("number 12500 number 18200").OnlyNumbers()
#--> 1250018200
test de la bibliothèqueaucune extension
Pad the string to length n with spaces (mutating). 1 exemples exécutés
o1 = new stzString("ABC")
o1.ExtendTo(5)
# it is padded to width 5 with spaces
? o1.Content()
#--> ABC
test de la bibliothèqueQCSXTZZZIBWU
Remove pcSub only where it is bounded by the given bounds (mutating). 1 exemples exécutés
o1 = new stzString("__^^^__^^♥^^__")
o1.RemoveSubStringBoundedBy("♥", "^^")
# heart gone, carets stay
? o1.Content()
#--> __^^^__^^^^__
test de la bibliothèqueQCSXTZZZIBWU
Same as RemoveNFirstChars: Remove the first n chars (mutating). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveNCharsLeft(2)
? o1.Content()
#--> nana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as RemoveNLastChars: Remove the last n chars (mutating). 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveNCharsRight(2)
? o1.Content()
#--> banana spl
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
BoxEachChar
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 extension
Box each char in its own cell, in place (mutating). 2 exemples exécutés
o1 = new stzString("SOFTANZA")
o1.BoxifyChars()
# eight cells
? o1.Content()
#--> ┌───┬───┬───┬───┬───┬───┬───┬───┐
#--> │ S │ O │ F │ T │ A │ N │ Z │ A │
#--> └───┴───┴───┴───┴───┴───┴───┴───┘
test de la bibliothèqueQCSXTZZZIBWU
FindAnyBoundedByAsSectionss
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és
o1 = new stzString("--[...]---[...]---[...]---[~~~]--[~~~]--")
o1.ReplaceOccurrences([ 2, :and = 3 ], :of = "[...]", :by = [ "ONE", :and = "TWO" ])
# first block untouched
? o1.Content()
#--> --[...]---ONE---TWO---[~~~]--[~~~]--
test de la bibliothèqueQCSXTZZZIBWU
FindConsecutiveSubStringsOfNChars
FindConsecutiveSubStringsOfNChars(n): the unique phase offsets that carry at least one full window (the original returns U(XT) over the per-window phase labels).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindConsecutiveSubStringsOfNChars(2) )
#--> [ 1, 2 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
StringCase(): 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
#--> uppercase
test de la bibliothèqueaucune extension
FindBoundedBy
Same as FindBoundedByCS: FindBoundedBy / FindBoundedByCS -- the most common spelling in narrative tests. Returns the [startPos, endPos] of each bounded section. FindBoundedBy: the content START positions of the bounded regions (the ZZ / AsSections forms carry the spans).
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindBoundedBy([ "an", "a" ]) )
#--> [ 4, 6 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same 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
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
FindDuplicatesAsSections
(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)
#--> na
composé à partir de la signature, exécuté pour cette page
aucune extension
FindFirstRegex
(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")
#--> 2
composé à 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
ExtractPattern
Same as ExtractPatternCS: ENGINE-DIRECT regex EXTRACTION: the matched TEXT of every match in ONE call (emails, URLs, dates, IDs, hashtags). FindAllRegex returns match POSITIONS; this returns the matched substrings themselves. Was a Haro while-loop (MatchAt + CaptureText per match).aussi écrite: RegexMatches · ExtractMatches
exemple composé
o1 = new stzString("banana split")
? @@( o1.ExtractPattern("an") )
#--> [ "an", "an" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ExtractEmails
Convenience extractors over ExtractPattern for the common entity types. Char classes ([0-9] etc.) are used instead of \d/\w to avoid Haro string escaping. Return the matched substrings.aucune extension
ExtractURLs
The URLs found in the string.aucune extension
ExtractIPv4Addresses
The IPv4 addresses found in the string.aussi écrite: ExtractIPAddressesaucune extension
ExtractHashtags
The #hashtags found in the string.aucune extension
ExtractMentions
The @mentions found in the string.aucune extension
ExtractDates
The dates found in the string (ISO or slashed form).aucune extension
ExtractTimes
The times found in the string.aucune extension
ExtractPhoneNumbers
The phone numbers found in the string.aussi écrite: ExtractPhonesaucune extension
ExtractPrices
The prices (currency symbol + number) found in the string.aucune extension
CountSubStrings
Note: NumberOfSubStrings / NumberOfSubStringsCS / NumberOfSubStringsU without args (combinatorial enumeration count) are defined at the class top with the SubStrings group; here we keep only the differently-named occurrence-count alias for clarity.
exemple composé
o1 = new stzString("banana split")
? o1.CountSubStrings("an")
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
Same as CountCS: How many times the given substring occurs. 5 exemples exécutésaussi écrite: NumberOfOccurrences
exemple composé
o1 = new stzString("banana split")
? o1.Count("an")
#--> 2
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
CountOverlapping
Same as CountOverlappingCS: How many times it occurs, counting OVERLAPPING matches.
exemple composé
o1 = new stzString("banana split")
? o1.CountOverlapping("an")
#--> 2
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
CountLeadingChar
count leading / trailing char
exemple composé
o1 = new stzString("banana split")
? o1.CountLeadingChar("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
CountTrailingChar
count leading / trailing char
exemple composé
o1 = new stzString("banana split")
? o1.CountTrailingChar("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
CountRegex
How many matches of the given regex pattern.
exemple composé
o1 = new stzString("banana split")
? o1.CountRegex("an")
#--> 2
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
IsEither
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)
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
split at -- dispatcher (case-sensitive by default) 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAt(" ") )
#--> [ "banana", "split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
SplitBefore
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
QCSXTZZZIBWU
SplitBefore 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 extension
Split 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 extension
SplitBeforeCharsW(pcCondition): split into pieces that begin at each char where the predicate is TRUE. Engine-backed via FindCharsW (no eval). Replaces the retired SplitBeforeCharsWXT. 1 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 extension
SplitAfterCharsW
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 extension
SplitBeforeSubStringsW
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 extension
SplitAfterSubStringsW
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 extension
SplitAtSubStringsW
SplitAtSubStringsW(pcCondition): split AT the substrings matching the predicate -- the matched substrings are dropped (delimiters), the pieces between are returned. Engine-backed (W) and anonymous-function (WF) forms, no eval().
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAtSubStringsW("@char = 'a'") )
#--> [ "banana split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUF
SplitAfter
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
QCSXTZZZIBWU
SplitAround
Same as SplitAroundCS: The pieces between the occurrences of pcSubStr (codepoint-aware).aussi écrite: SplitAroundSubString
exemple composé
o1 = new stzString("banana split")
? @@( o1.SplitAround("an") )
#--> [ "b", "", "a split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Partition
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 extension
RPartition
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 extension
SplitByRegex
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
QCSXTZZZIBWU
SplitAtPosition
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 extension
SplitAtPositions
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 split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertAfterSubString
Same as InsertAfterSubStringCS: inserting before / after all occurrences
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterSubString("an", "an")
? o1.Content()
#--> banananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertBeforeFirst
Same as InsertBeforeFirstCS: inserting before first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeFirst("an", "an")
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertAfterFirst
Same as InsertAfterFirstCS: inserting after first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterFirst("an", "an")
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertBeforeLast
Same as InsertBeforeLastCS: inserting before first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeLast("an", "an")
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertAfterLast
Same as InsertAfterLastCS: inserting after first / last occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterLast("an", "an")
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertBeforeNth
Same as InsertBeforeNthCS: inserting before nth occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertBeforeNth(2, "an", "an")
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
InsertAfterNth
Same as InsertAfterNthCS: inserting after nth occurrence
exemple composé
o1 = new stzString("banana split")
o1.InsertAfterNth(2, "an", "an")
? o1.Content()
#--> bananana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveCharAt
Same as RemoveSection: Remove the chars at positions n1..n2 (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveCharAt(2)
? o1.Content()
#--> bnana split
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveAtPosition
Same as RemoveSection: Remove the chars at positions n1..n2 (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveAtPosition(2)
? o1.Content()
#--> bnana split
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveSpaces
Remove all the spaces (mutating).
exemple composé
o1 = new stzString("banana split")
o1.RemoveSpaces()
? o1.Content()
#--> bananasplit
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveSpacesInSections
RemoveSpacesInSections(aSections): remove every space inside the given [n1, n2] sections. Walks sections in descending start-pos order so earlier sections stay valid after later edits.QCSXTZZZIBWU
RemoveLeadingSpaces
Same as TrimLeft: Remove the leading spaces in place (mutating). For a copy, use TrimmedLeft.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 · WithoutSpaces
exemple composé
o1 = new stzString("banana split")
? o1.SpacesRemoved()
#--> bananasplit
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as SubStringsSpacifiedCS: SubStringsSpacifiedCS / TheseSubstringsSpacifiedCS: wrap every occurrence of any substring in pacSubStr with spaces in the string content, return result. Used by stzCCode.Transpile to normalise token boundaries for downstream regex passes. Ported from archive line 91253; implementation collapses to a simple repeated substr-replace (Haro's built-in is global). Case-insensitive path uses a case-folded scan + position-aware splice so the result preserves the original casing of non-matched chars. 2 exemples exécutésaussi écrite: TheseSpacified · TheseSubstringsSpacified
o1 = new stzString("iloveringprogramminglanguage")
? o1.TheseSubStringsSpacified([ "php", "ruby" ]) # Nothing happens because these substrings
#--> iloveringprogramminglanguage
test de la bibliothèqueQCSXTZZZIBWU
Same as SpacifySubStringsUsingCS: SpacifySubStringsUsing: in-place variant of SubStringsSpacified that lets the caller choose the separator (default would be a single space; this form makes it explicit). Wraps every occurrence of each substring in pacSubStr with the given separator on both sides. SpacifySubStringsUsingCS: find ALL the substrings' sections at once (sorted), drop the ones strictly included in their predecessor (so "in" inside "Haro" survives as part of "Haro"), bound each kept section with the separator on BOTH sides, then collapse duplicate separators (adjacent tokens share one) and strip them from the edges. Satisfies the archive triple: blocks 133, 306, 307. 2 exemples exécutés
o1 = new stzString("whatisyournameplease?")
o1.SpacifySubStringsUsing(["is", "your", "name"], "_")
? o1.Content()
#--> what_is_your_name_please?
test de la bibliothèqueQCSXTZZZIBWU
SpacifySubStringUsing
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és
o1 = new stzString("__♥__♥__♥__")
o1.AddXT(" ", :AroundEach = "♥")
# every heart breathes
? o1.Content()
#--> __ ♥ __ ♥ __ ♥ __
test de la bibliothèqueQCSXTZZZIBWU
FindAnySubStringBoundedByZZ
Same as FindSubStringsBoundedByZZ: FindSubStringsBoundedByZZ: exclusive-bounds variant. Returns the position-pair list for the INNER content (without the bound chars). Derived from the IB result by shifting the start past the open token and the end before the close token.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnySubStringBoundedByZZ([ "an", "a" ]) )
#--> [ [ 4, 3 ] ]
composé à partir de la signature, exécuté pour cette page
aucune extension
FindAnySubStringsBoundedByZZ
Same as FindSubStringsBoundedByZZ: FindSubStringsBoundedByZZ: exclusive-bounds variant. Returns the position-pair list for the INNER content (without the bound chars). Derived from the IB result by shifting the start past the open token and the end before the close token.
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindAnySubStringsBoundedByZZ([ "an", "a" ]) )
#--> [ [ 4, 3 ] ]
composé à partir de la signature, exécuté pour cette page
aucune extension
RemoveThisTrailingChar: strip repeated trailing occurrences of a single given char. "abc!!" + RemoveThisTrailingChar("!") -> "abc". Ported from the legacy monolithic archive (~line 27306-27389); standalone byte-level implementation that avoids cascading dependencies on FindRepeatedTrailingChars*. 1 exemples exécutés
o1 = new stzString("12.4560000")
o1.RemoveThisTrailingChar("0")
# mutated in place
? o1.Content()
# or functionally
? Q("12.45600").ThisTrailingCharRemoved("0")
#--> 12.456
#--> 12.456
test de la bibliothèqueQCSXTZZZIBWU
A copy with the trailing run of the given char removed. 1 exemples exécutés
o1 = new stzString("12.4560000")
o1.RemoveThisTrailingChar("0")
# mutated in place
? o1.Content()
# or functionally
? Q("12.45600").ThisTrailingCharRemoved("0")
#--> 12.456
#--> 12.456
test de la bibliothèqueaucune extension
ThisLeadingCharRemoved
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és
o1 = new stzString("000122.12")
# the leading char
? o1.LeadingChar()
o1.RemoveThisLeadingChar("0")
# the run is gone
? o1.Content()
#--> 0
#--> 122.12
test de la bibliothèqueQCSXTZZZIBWU
RemoveDuplicates
Same as RemoveDuplicatesCS: Remove the 2nd+ occurrences of each duplicated char, keeping the first (mutating).QCSXTZZZIBWU
Same as RemoveFromLeftCS: removing substring from left / right 1 exemples exécutés
o1 = 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èqueQCSXTZZZIBWU
Same as RemoveFromRightCS: Remove pcSubStr from the visual RIGHT end (direction-aware, mutating). 1 exemples exécutés
o1 = 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èqueQCSXTZZZIBWU
Remove nRange chars starting at nStart (mutating). 1 exemples exécutés
o1 = new stzString("extrasection")
o1.RemoveRange(1, 5)
# range removed
? o1.Content()
#--> section
test de la bibliothèqueaucune extension
FindDuplicates
FindDuplicates -- positions of duplicated chars in the content. A char is "duplicated" if it appears more than once anywhere. Returns the 2nd+ occurrence positions (so the FIRST occurrence is not reported, matching stzList.FindDuplicates semantics).aussi écrite: DuplicationsZ · DuplicateCharsZ
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindDuplicates() )
#--> [ 4, 5, 6 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as FindDupSecutiveCharsCS: ENGINE-BACKED (StzEngineStringFindDupSecutiveCharsCS): positions of each char equal to the one before it. Retires the O(len) CharAt loop. pCaseSensitive=0 compares case-insensitively (per-codepoint casefold). 3 exemples exécutésaussi écrite: DupSecutiveCharsZ
oA = new stzString("a")
s = new stzString( oA.Repeated(1000) )
# ConsecutiveSubStrings count is 375,250
? len(s.ConsecutiveSubStrings())
# FindDupSecutiveChars is 999 (positions 2..1000)
? len(s.FindDupSecutiveChars())
#--> 375250
#--> 999
test de la bibliothèqueQCSXTZZZIBWU
Same as FindDupSecutiveSubStringCS: FindDupSecutiveSubString: positions where the substring at i+1 equals the substring of the same length ending at i (i.e. back-to-back identical substrings). Returns the start positions of the second copy in each consecutive pair. ENGINE-BACKED (StzEngineStringFindDupSecutiveSubStringCS): start of the second copy in each back-to-back identical-substring pair. Retires the O(len) Haro while-loop (2 EngineSlice round-trips per step). pCaseSensitive=0 compares the substrings case-insensitively. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? @@( o1.FindDupSecutiveSubString("an") )
#--> [ 4 ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
DupSecutiveSubStringZ
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
QCSXTZZZIBWU
DupSecutiveSubStrings
The plural family: every substring that occurs duplicated back-to-back somewhere in the string (derived, per the original monolith, from the consecutive-duplicate items of the phase-tiled ConsecutiveSubStrings() list), with the positions/sections of the duplicate occurrences. NOTE (engine backlog): O(n^2) Haro-side enumeration -- move the window scan + dup detection engine-side.
exemple composé
o1 = new stzString("banana split")
? @@( o1.DupSecutiveSubStrings() )
#--> [ "na", "an" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
FindDupSecutiveSubStrings
(sans commentaire dans la source : le nom se lit comme une phrase) find dup secutive sub stringsdans la section find first starting at
exemple 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 at
exemple composé
o1 = new stzString("banana split")
o1.RemoveDupSecutiveSubStrings()
? o1.Content()
#--> ban split
composé à 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 at
exemple composé
o1 = new stzString("banana split")
? o1.DupSecutiveSubStringsRemoved()
#--> ban split
composé à 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
#--> 1
test 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
#--> 1
test 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
QCSXTZZZIBWU
NumberOfLetters
(sans commentaire dans la source : le nom se lit comme une phrase) number of lettersdans la section find first starting at
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfLetters()
#--> 11
composé à 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
#--> 1
test de la bibliothèqueQCSXTZZZIBWU
IsPluralOfAStzType: 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
#--> 1
test de la bibliothèqueaucune extension
AllCharsAreEven
AllCharsAre extension: :Even / :Odd / :Positive for digits. Augment the existing kind list via inline checks.
exemple composé
o1 = new stzString("banana split")
? o1.AllCharsAreEven()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
AllCharsAreOdd
(sans commentaire dans la source : le nom se lit comme une phrase) all chars are odddans la section find first starting at
exemple composé
o1 = new stzString("banana split")
? o1.AllCharsAreOdd()
#--> 0
composé à 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 at
exemple composé
o1 = new stzString("banana split")
? o1.AllCharsArePositive()
#--> 0
composé à 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")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
IsLessThan
TRUE if the string sorts BEFORE the given one.
exemple composé
o1 = new stzString("banana split")
? o1.IsLessThan("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsGreaterThan
TRUE if the string sorts AFTER the given one.
exemple composé
o1 = new stzString("banana split")
? o1.IsGreaterThan("an")
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
LevenshteinDistanceWith
The Levenshtein edit distance to the given string.aussi écrite: EditDistanceWith
exemple composé
o1 = new stzString("banana split")
? o1.LevenshteinDistanceWith("an")
#--> 10
composé à partir de la signature, exécuté pour cette page
aucune extension
CommonPrefixWith
Same as CommonPrefixWithCS: common prefix / suffixQCSXTZZZIBWU
CommonSuffixWith
Same as CommonSuffixWithCS: common prefix / suffixQCSXTZZZIBWU
DiffWith
The differences between the string and the given one.
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 extension
JaroSimilarityWith
jaro / jaro-winkler similarity
exemple composé
o1 = new stzString("banana split")
? o1.JaroSimilarityWith("an")
#--> 722
composé à partir de la signature, exécuté pour cette page
aucune extension
JaroWinklerSimilarityWith
jaro / jaro-winkler similarity
exemple composé
o1 = new stzString("banana split")
? o1.JaroWinklerSimilarityWith("an")
#--> 722
composé à partir de la signature, exécuté pour cette page
aucune extension
Soundex
The Soundex phonetic code of the string.
exemple composé
o1 = new stzString("banana split")
? o1.Soundex()
#--> B521
composé à partir de la signature, exécuté pour cette page
aucune extension
Metaphone
The Metaphone phonetic code of the string.
exemple composé
o1 = new stzString("banana split")
? o1.Metaphone()
#--> BNNSPL
composé à partir de la signature, exécuté pour cette page
aucune extension
The (dominant) script of the string. 2 exemples exécutés
# Inherited
? StzStringQ(" 4  " + ArabicDhammah() + "  ").Script()
#--> inherited
test de la bibliothèqueaucune extension
Scripts
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 extension
NumberOfScripts
How many scripts the string uses.
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfScripts()
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
IsScriptOfText
callable on the stzString that TQ()/StzTextQ()/QQ() return)
exemple composé
o1 = new stzString("banana split")
? o1.IsScriptOfText("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsLatinScript
TRUE if the string is written in the Latin script.
exemple composé
o1 = new stzString("banana split")
? o1.IsLatinScript()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
IsArabicScript
TRUE if the string is written in the Arabic script.aussi écrite: IsArabic
exemple composé
o1 = new stzString("banana split")
? o1.IsArabicScript()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsHanScript
TRUE if the string is written in the Han script.
exemple composé
o1 = new stzString("banana split")
? o1.IsHanScript()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsHybridScript
TRUE if the string mixes several scripts.
exemple composé
o1 = new stzString("banana split")
? o1.IsHybridScript()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCommonScript
TRUE if the chars belong to the Common script.
exemple composé
o1 = new stzString("banana split")
? o1.IsCommonScript()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsInheritedScript
TRUE if the chars belong to the Inherited script.
exemple composé
o1 = new stzString("banana split")
? o1.IsInheritedScript()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
NthWord
The nth word of the text.
exemple composé
o1 = new stzString("banana split")
? o1.NthWord(2)
#--> split
composé à partir de la signature, exécuté pour cette page
aucune extension
FirstWord
The first word of the string.
exemple composé
o1 = new stzString("banana split")
? o1.FirstWord()
#--> banana
composé à partir de la signature, exécuté pour cette page
aucune extension
LastWord
The last word of the string.
exemple composé
o1 = new stzString("banana split")
? o1.LastWord()
#--> split
composé à partir de la signature, exécuté pour cette page
aucune extension
UniqueWords
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
QCSXTZZZIBWU
ContainsWord
Same as ContainsWordCS: TRUE if the string contains the given WORD (word-boundary aware).
exemple composé
o1 = new stzString("banana split")
? o1.ContainsWord("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
ReverseWords
Reverse the ORDER of the words in place (mutating).
exemple composé
o1 = new stzString("banana split")
o1.ReverseWords()
? o1.Content()
#--> split banana
composé à partir de la signature, exécuté pour cette page
aucune extension
SortWords
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")
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
MostFrequentWord
The word that occurs most often in the string.
exemple composé
o1 = new stzString("banana split")
? o1.MostFrequentWord()
#--> banana
composé à partir de la signature, exécuté pour cette page
aucune extension
MostFrequentWords
The top-N most frequent words as [[word, count], ...] (count desc). ENGINE-DIRECT one-pass word frequency -- the classic text-analytics workload (search indexing, tag clouds, NLP) that was O(unique x length).
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 extension
WordsAndTheirCounts
[[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 extension
CharsAndTheirCounts
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
QCSXTZZZIBWU
MostFrequentChars
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
QCSXTZZZIBWU
MostFrequentChar
The char that occurs most often in the string.
exemple composé
o1 = new stzString("banana split")
? o1.MostFrequentChar()
#--> a
composé à partir de la signature, exécuté pour cette page
aucune extension
NGramsAndTheirCounts
Same as NGramsAndTheirCountsCS: Sequences of n consecutive words (n=2 bigrams, 3 trigrams). Language modeling, autocomplete, collocation detection, plagiarism. [[ngram, count], ...] for every distinct n-gram (first-appearance order).
exemple composé
o1 = new stzString("banana split")
? @@( o1.NGramsAndTheirCounts(2) )
#--> [ [ "banana split", 1 ] ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
MostFrequentNGrams
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
QCSXTZZZIBWU
Collocations
Same as CollocationsCS: Word pairs that co-occur far more than chance ("machine learning", "New York"). nMinCount filters rare pairs. Returns top-N phrases by PMI.QCSXTZZZIBWU
MostSignificantCollocations
Same as CollocationsCS: Word pairs that co-occur far more than chance ("machine learning", "New York"). nMinCount filters rare pairs. Returns top-N phrases by PMI.
exemple composé
o1 = new stzString("banana split")
? @@( o1.MostSignificantCollocations(2) )
#--> [ "banana split" ]
composé à partir de la signature, exécuté pour cette page
aucune extension
CosineSimilarityWith
Same as CosineSimilarityWithCS: Bag-of-words cosine between this text and another: 1.0 = same term distribution, 0.0 = nothing shared. Plagiarism, near-duplicate, "find similar". (For corpus TF-IDF weighting see StzTFIDFKeywords.)aussi écrite: SimilarityWith
exemple composé
o1 = new stzString("banana split")
? o1.CosineSimilarityWith("an")
#--> 0
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
AverageWordsPerSentence
Sentence = text up to each . ! ? terminator. All engine-direct, no materialization: averages come from cached engine counts; the extremes from one segmenting pass.
exemple composé
o1 = new stzString("banana split")
? o1.AverageWordsPerSentence()
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
AverageCharsPerSentence
The average number of chars per sentence.
exemple composé
o1 = new stzString("banana split")
? o1.AverageCharsPerSentence()
#--> 12
composé à partir de la signature, exécuté pour cette page
aucune extension
LongestSentenceInWords
The word count of the longest sentence.
exemple composé
o1 = new stzString("banana split")
? o1.LongestSentenceInWords()
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
ShortestSentenceInWords
The word count of the shortest sentence.
exemple composé
o1 = new stzString("banana split")
? o1.ShortestSentenceInWords()
#--> 2
composé à partir de la signature, exécuté pour cette page
aucune extension
How many sentences the string holds. 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? o1.NumberOfSentences()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
UAX#29 sentence segmentation (engine-backed), aligned with NumberOfSentences() -- correctly keeps "Dr. Smith", "3.14", "U.S.A." as one sentence rather than splitting on every '.'. Bulk native-list bridge (O(n)). 2 exemples exécutés
exemple composé
o1 = new stzString("banana split")
? @@( o1.Sentences() )
#--> [ "banana split" ]
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWUQQQQQ
The nth sentence of the string. 1 exemples exécutésaucune extension
FirstSentence
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()
#--> 1
composé à partir de la signature, exécuté pour cette page
aucune extension
Paragraphs
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 extension
NthParagraph
The nth paragraph of the string.aucune extension
Collapse the whitespace runs to single spaces (mutating). 2 exemples exécutés
o1 = new stzString("  lots   of    whitespace  ")
# edges trimmed
? o1.Trimmed()
# then squeezed and shouted
? o1.SimplifyQ().Uppercased()
#--> lots   of    whitespace
#--> LOTS OF WHITESPACE
test de la bibliothèqueQCSXTZZZIBWUExcept
A 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 extension
ToSlug
The string turned into a URL slug (lowercase, hyphens).
exemple composé
o1 = new stzString("banana split")
? o1.ToSlug()
#--> banana-split
composé à partir de la signature, exécuté pour cette page
aucune extension
Initials
The initial letter of each word.
exemple composé
o1 = new stzString("banana split")
? o1.Initials()
#--> bs
composé à partir de la signature, exécuté pour cette page
aucune extension
ToHex
The string's bytes in hexadecimal form.
exemple composé
o1 = new stzString("banana split")
? o1.ToHex()
#--> 62616e616e612073706c6974
composé à partir de la signature, exécuté pour cette page
aucune extension
FromHex
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 ' -> &#39;) 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 &apos; &nbsp; and numeric entities (&#NN; / &#xHH;), which the five-replace version silently left intact -- a widening, not a behaviour change for anything the old code handled.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 01110100
composé à partir de la signature, exécuté pour cette page
aucune extension
ToOctal
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 164
composé à partir de la signature, exécuté pour cette page
aucune extension
EscapedForRegex
The string with the regex special chars escaped. One engine pass. This used to build a per-character LIST of the whole string (@oString.Chars()) and scan the metacharacter set for each one, which allocates a Haro object per character to answer a question about 14 ASCII bytes. Same set, same result.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
#--> Tunis
test de la bibliothèqueaucune extension
ApplyTitlecase
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és
o1 = new stzString("exeeeeeTUNIS")
# no repeated leading char
? o1.RepeatedLeadingChar()
# empty list
? len( o1.RepeatedLeadingChars() )
#--> 0
test de la bibliothèqueQCSXTZZZIBWU
RepeatedTrailingChars
Same as RepeatedTrailingCharsCS: The trailing repeated-char run, as a list (case dial).QCSXTZZZIBWU
Same as RemoveRepeatedLeadingCharsCS: ensure prefix / suffix 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveRepeatedLeadingChars()
? o1.Content()
#--> anana split
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
Same as RemoveRepeatedTrailingCharsCS: ensure prefix / suffix 1 exemples exécutés
exemple composé
o1 = new stzString("banana split")
o1.RemoveRepeatedTrailingChars()
? o1.Content()
#--> banana spli
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
EnsurePrefix
Same as EnsurePrefixCS: ensure prefix / suffixQCSXTZZZIBWU
EnsureSuffix
Same as EnsureSuffixCS: ensure prefix / suffixQCSXTZZZIBWU
Same as RemoveFromStartCS: removing from start / end 2 exemples exécutésQCSXTZZZIBWU
Remove pcSuffix from the end of the string when it ends with it (mutating). 2 exemples exécutés
o1 = new stzString("programming*")
o1.RemoveFromEnd("*")
# bare word
? o1.Content()
#--> programming
test de la bibliothèqueQCSXTZZZIBWU
RemovedFromEnd
Same as RemovedFromEndCS: Immutable / past-tense companions: return the modified content without mutating This. Used by stzNumber.RoundTo() and similar fluent chains that want the result as a value.QCSXTZZZIBWU
NthLine
The nth line of the string.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
QCSXTZZZIBWU
SortLines
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
QCSXTZZZIBWU
Same as TrimCharCS: trimming a specific char 1 exemples exécutés
o1 = new stzString("♥♥♥123♥♥♥")
o1.TrimChar("♥")
# bare digits
? o1.Content()
#--> 123
test de la bibliothèqueQCSXTZZZIBWU
TrimLeftChar
Same as TrimLeftCharCS: Trim the run of the given char from the START (mutating).QCSXTZZZIBWU
TrimRightChar
Same as TrimRightCharCS: Trim the run of the given char from the END (mutating).QCSXTZZZIBWU
IsNeither
Same as IsNeitherCS: IsNeither: TRUE when this string equals neither argument (the -- :Nor named-param spells the second). Restored from the monolith.
exemple composé
o1 = new stzString("banana split")
? o1.IsNeither("an", "an")
#--> 1
composé à partir de la signature, exécuté pour cette page
QCSXTZZZIBWU
RemoveAnyCharFromLeft/Right: strip the whole leading/trailing run -- of a given char (aliases of RemoveCharFromLeft/Right). 1 exemples exécutésaucune extension
Same as RemoveCharFromRight: Drop the trailing chars matching pcChar from the end of the string (mutating). 1 exemples exécutésaucune extension
Each 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 extension
IsLanguageIdentifier
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()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsScriptIdentifier
TRUE if the string identifies a script (number, code or abbreviation).
exemple composé
o1 = new stzString("banana split")
? o1.IsScriptIdentifier()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsCountryIdentifier
TRUE if the string identifies a country (number, code, name...).
exemple composé
o1 = new stzString("banana split")
? o1.IsCountryIdentifier()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension
IsLanguageNameOrAbbreviation
TRUE if the string is a language name or abbreviation.
exemple composé
o1 = new stzString("banana split")
? o1.IsLanguageNameOrAbbreviation()
#--> 0
composé à partir de la signature, exécuté pour cette page
aucune extension