Hi,
I'm playing with OpenAI Assistants API.
I have read we are not doing loops in Toddle, but I can't get the logic of how to solve this case.
What I don't understand
I need to iterate over, or "know" how to replace all instances in a string, with new data, based on another array.
I have a string:
Hello [text_1] this is a string. [text_2]
I have an array (simplified example):
[
{
"text": "[text_1]"
},
{
"text": "[text_2]"
}
I want to replace [text_1] with "[0]" and [text_2] with "[1]". (Use index for now, maybe something else later)
Desired result:
Hello [0] this is a string. [1]
Any ideas?