Hello
I’m trying to build - what I think is - a complex string function and I’m strugging.
From a string, I want to cut out a part of it in the middle.
What I would like to do is something like this:
originalString = “Apple, Banana, Pear, Peach”;
toRemove = “Banana”;
start = originalString.indexOf(toRemove);
left = originalString.slice(0, start);
right = originalString.slice(start + toRemove.length);
result = left.concat(right);
Let’s say, I want this to work on the click of a button, which updates the text on a box.
In Interactions I use: OnClick -> setText
And I’m stuck. There’s only one field there. Of course, all of this can be combined into one complex phrase:
[[originalString.slice(0, originalString.indexOf(toRemove)).contact(originalString.slice(originalString.indexOf(toRemove) + toRemove.length))]]
The problem is, that this is not working.
Please check the uploaded file and let me know what am I doing wrong?
Thank youtmp.rp (47.7 KB)