StringTools
Repeats
compute the maximal repeated substrings in a string
Calling Sequence
Parameters
Description
Examples
Repeats( s )
s
-
Maple string
The Repeats(s) command returns an expression sequence of lists indicating the maximal repeated substrings of the input string s.
Each list has the form pos1,pos2,len, where pos1 is the position in s at which the first member of the repeat starts, pos2 is the position in s at which the second member of the repeat starts, and len is the length of the repeated substring appearing at positions pos1 and pos2 in s.
All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
with⁡StringTools:
Repeats⁡abcde
Repeats⁡abab
1,3,2
Repeats⁡ababa
1,5,1,1,3,3
Repeats⁡abababa
1,7,1,1,5,3,1,3,5
See Also
string
Download Help Document