Strings: is there a way to do 'nth indexOf'?


#1

Hey all, I’ve got a comma separated string stored in a variable like this:

price,color,size,discount

example value would be: 4.99,red,medium,2

Before I added the last piece, I was using indexOf and lastIndexOf to parse out the stuff between the commas. Now I’ve added a third comma, I need something like ‘nth indexOf’. Does such a thing exist in Axure?

Thank you


#2

Depending on how you build that list I might just use a unique separator for each position.


#3

Oh that’s an awesome idea - thank you!


#4

You can nest multiple “indexOf”

nthIndexOf.rp (48.1 KB)


#5

Very nice - Thank you for this!