I managed to cut the second and third, but can’t find a solution for the first and fourth with the same function.
The file with the example is here: Cutting-a-string.rp (48.4 KB)
I assume by JS you mean Axure’s built-in javascripty functions.
The only way I can think to do this is to create a loop that grabs the first item from the array and adds it to a tempArray if it’s not the undesired item. Since Axure doesn’t have loops, you’ll have to do it recursively. You’ll use the OnMove interaction of a hotspot or whatever to trigger the “function.” loopVar starts out at 0 and tempArray starts out blank. origArray holds the array.
Pseudocode:
OnMove
if origArray still has a comma
grab the first item, including the comma
remove the same from origArray
increment loopVar
Else if origArray is not null
It's the last item, so grab the whole of origArray
set origArray to null
increment loopVar
If loopVar isn't the undesired index
add the grabbed value from either condition above to tempArray
If origArray isn't null
we're not done, so move this (to trigger OnMove again - the recursive call)
else
we're done, so set origArray to tempArray
set loopVar to 0
clear tempArray
get rid of the trailing comma on origArray if it exists.
Here’s an example, with comments. The hotspot in _system has the code. removeItemFromArray.rp (59.4 KB)