NumberOfConsecutiveSubStrings()
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).
Exemples de base (1)
o1 = new stzString("phpringringringpythonrubyruby")
# their total number is Sum(29-i+1, i=1..14)
? o1.NumberOfConsecutiveSubStrings()
acAll = o1.ConsecutiveSubStrings()
# the list carries all 315 windows
? len(acAll)
# it starts with the single chars
? acAll[1] + acAll[2] + acAll[3]
# the length-2 windows follow, phase-major
? acAll[30] + "/" + acAll[31] + "/" + acAll[44]
# it ends with the last length-14 window
? acAll[315]
anPos = o1.FindConsecutiveSubStrings()
# the Find form reduces to 1..29
? len(anPos)
# ... starting at 1
? anPos[1]
# ... ending at 29
? anPos[29]315 315 php ph/pr/hp ngpythonrubyru 29 1 29
exécuté le 2026-10-02 04:24 dans la bibliothèque au commit 0e72e2e2c ; tiré de 292_numberofconsecutivesubstrings.ring(s'ouvre dans un nouvel onglet)
Les extensions de cette méthode
Chaque extension, et si elle existe pour cette méthode ; une extension qui existe se compose avec les autres (FindSTCS).
Chaque exemple est un fichier de test de la bibliothèque, exécuté dans la bibliothèque pour cette page ; seuls ceux dont la sortie a tenu toutes les promesses écrites par leur fichier sont montrés. Les explications, les titres et le code sont ceux de la bibliothèque, en anglais.

