I have strings each of which is one or more copies of some string. For example:
L = "hellohellohello"
M = "good"
N = "wherewhere"
O = "antant"
I would like to split such strings into a list so that each element just has the part that was repeated. For example:
splitstring(L) ---> ["hello", "hello", "hello"]
splitstring(M) ---> ["good"]
splitstring(N) ---> ["where", "where"]
splitstring(O) ---> ["ant", "ant"]
As the strings are each about 1000 characters long it would be great if this was reasonably fast as well.
Note that in my case the repetitions all start at the start of the string and have no gaps in between them so it's much simpler than the general problem of finding maximal repetitions in a string.
How can one do this?