I need to find consecutive (non-overlapping) repetitions of a substring in a string. I can count them but not consecutive. For instance:
string = "AASDASDDAAAAAAAAERQREQREQRAAAAREWQRWERAAA"
substring = "AA"
here, "AA"
is repeated one time at the beginning of the string, then 4 times, then 2 times, etc.
I should select the biggest one, in this example - 4 times.
How can I do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…