Help with complicated string operations (Solved by me)

I'm making a function that converts string "ordinals" with an index like FGH, but i'm having trouble making it.


For example, I want to make 1212[4]. I need to know how to make it expand for a certain part, not the full thing.
How I want it to expand:
1212 ->
"Separate" the string into 2 parts:
12|12
12|1111
121111
How it expands:
1212 ->
121121121121
(Infinite Recursion, which is bad)
This means it will cause infinite expansion.
Here is another example:
1232[4]->
1232->
123123123123->
12312312312222->
123123123122122122122->
12312312312212212212121212->
1231231231221221221212121111->
... (Finite but large Recursion)
How it expands:
1232->
123123123123->
1231231231222->
123123123122123123123122123123123122123123123122->
(Infinite Recursion)
EDIT: I found it out.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.